Skip to content

Storing an ArrayBuffer doesn't get retrigger when setting a new value #104

Open
@dumconstantin

Description

@dumconstantin

Producer b is only called once:

const a: producer = ({ foo = update.value }) => {
  const int32 = new Int32Array(2);
  int32[0] = 42;
  foo.set(int32);
  setTimeout(() => {
    int32[1] = 43;
    foo.set(int32);
  });
};
const b: producer = ({ foo = observe.value}) => {
  console.log("foo is", foo);
};

But first setting the value to null and then async setting it to the next array buffer value, the b producer is called twice as it should:

const a: producer = ({ foo = update.value }) => {
  const int32 = new Int32Array(2);
  int32[0] = 42;
  foo.set(int32);
  setTimeout(() => {
    int32[1] = 43;
    foo.set(null);
    setTimeout(() => {
      foo.set(int32);
    })
  });
};

This has to do with the comparison logic as I've tested with different values in the buffer/different buffers and it still doesn't retrigger on update.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions