Skip to content

[Bug Report] options is not reactive when updating after creating #10

@ylc395

Description

@ylc395

Reproduction

const enabled = observable.box(false);

const query = createQuery(
  () => Promise.resolve(Date.now()),
  {
    options: () => ({
      enabled: enabled.get(),
    }),
  }
);

// this won't trigger fetching, which is unexpected
enabled.set(true);

Possible Solution:

reaction(() => config.options!(this), this.update, {

Maybe this reaction should be fireImmediately? Not sure

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions