-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Copy link
Description
injectMutationState
accepts a custom injector through an options object:
class MyComponent {
injector = inject(Injector);
mutationState = injectMutationState(
() => ({
filters: {},
}),
{ injector: this.injector },
);
}
The other functions do this directly via a parameter:
class MyComponent {
injector = inject(Injector);
query = injectQuery(
() => ({
queryKey: ["posts"],
queryFn: () =>
fetch("https://jsonplaceholder.typicode.com/posts").then((res) =>
res.json(),
),
}),
this.injector,
);
}
Includes injectDevtoolsPanel
in the Angular devtools package. This should be made consistent. While passing an options object as parameter is a bit more verbose it matches Angular APIs such as effect
and allows adding more options in the future.
BThomann