Skip to content

Computed Signals based on Computed Signals could not be updated #6

@CKussin

Description

@CKussin

Hey there,

first of all. Amazing work! As an angular dev i love this lib. it's just great.

But here is the reason for this Issue:

If i use something like the following:

`
public class Test {

public Signal BaseSignal { get; } = new("value");
public IReadOnlySignal FirstLevelComputed => Signal.Computed(() => {
if(BaseSignal.Value == "value")
return 1;
return 0;
});
public IReadOnlySignal SecondLevelComputed => Signal.Computed(() => {
return FirstLevelComputed.Value == 1;
});
}
`
In the first iteration everything works as expected. Base:value, First:1, Second:true
But if i change the Base to let's say "label", then somethings not working correctly

Expected:
Base:label, First:0, Second:false

Reality:
Base:label, First:0, Second:true

It seems like the SecondLevelComputed is not updated properly

Any hint?

Best regards

PS: the behavior is the same if i create and assign the computed properties in the constructor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions