Skip to content

Approach to glitches #43

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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