Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(angular-query): run mutation callback in injection context (#7360)
* fix(angular-query-experimental): run mutation callback in injection context Previously, the injectMutation callback was run in injection context only if accessed in the same task as the component initialization (i.e. before the `effect` callback run). By running the effect run in injection context, it is ensured that the callback will always run in injection context, and any `inject` calls will not fail. Note there is a separate issue here, and it's that the callback is always run twice - once synchronously when initialization the mutation, and secondly as the first callback of the `effect`. This is something that can potentially be improved. No breaking changes, any code that worked before should still work. * run prettier * Catch error in test --------- Co-authored-by: Arnoud <[email protected]>
- Loading branch information