-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Very simliar to #10
My app breaks since mobx-tanstack-query@6.1.0. You can reproduce bug by:
const isEnabled = observable.box(false);
let query;
runInAction(() => {
query = createQuery(() => Promise.resolve({ status: 'success' }), {
enableOnDemand: true,
options: () => ({
enabled: isEnabled.get();
})
});
isEnabled.set(true);
});
query.result.data; // this won't trigger fetching, which is unexpectedThe reason is maybe related to action, which defer the calculation of initial value.
mobx-tanstack-query/src/query.ts
Line 463 in a017425
| reaction(getAllDynamicOptions, this.update, { |
How about add a fireImmediately to this reaction?
js2me
Metadata
Metadata
Assignees
Labels
No labels