Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow factory config in withEntitiesLoadingCall #95

Closed
gabrielguerrero opened this issue Jun 6, 2024 · 1 comment
Closed

Allow factory config in withEntitiesLoadingCall #95

gabrielguerrero opened this issue Jun 6, 2024 · 1 comment
Labels

Comments

@gabrielguerrero
Copy link
Owner

Allow an alternative way of using withEntitiesLoadingCall, that receives a factory function like with withCalls, this has the advantage of allowing us to use the store in the onSuccess and onError
example

withEntitiesLoadingCall(({ entitiesPagedRequest, entitiesFilter, se }) => ({
fetchEntities: async () => {
const res = await lastValueFrom(
inject(BranchService).getBranches({
search: entitiesFilter().search,
skip: entitiesPagedRequest().startIndex,
take: entitiesPagedRequest().size,
}),
);
return { entities: res.resultList };
},
onSuccess: ({ entities }) => {
// call the store signals.computed or methods or patchState
}
})),

gabrielguerrero pushed a commit that referenced this issue Jun 6, 2024
…ction for config

the factory function config will receive the store , and allow access to it in the fetchEntities,
onSuccess and onErro methods

Fix #95
gabrielguerrero pushed a commit that referenced this issue Jun 6, 2024
…ction for config

the factory function config will receive the store , and allow access to it in the fetchEntities,
onSuccess and onErro methods

Fix #95
Copy link

github-actions bot commented Jun 6, 2024

🎉 This issue has been resolved in version 17.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant