Skip to content

Approach to glitches #43

@zyla

Description

@zyla

When a node (A) occurs multiple times as a dependency of another node (B), B will fire many times for each firing of A, and some of the firings will have wrong value.

The following test case illustrates the problem:

    it("handles diamond dependencies without glitches", () => {
      const source = sinkBehavior(0);
      const b = lift((a, b) => a + b, source, source);
      const spy = subscribeSpy(b);
      assert.deepEqual(at(b), 0);
      source.push(1);
      assert.deepEqual(at(b), 2);
      assert.deepEqual(spy.args, [[0], [2]]);
    });

It fails with:

  1) behavior
       applicative
         handles diamond dependencies without glitches:

      AssertionError: expected [ [ 0 ], [ 1 ], [ 2 ] ] to deeply equal [ [ 0 ], [ 2 ] ]

The presence of value 1 indicates that the framework let the application observe inconsistent values for source (0 and 1 in this case).

Is this the expected behavior? If not, are there plans to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions