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

typedCallConfig storeResult: false doesnt remove result Prop type #136

Closed
gabrielguerrero opened this issue Sep 18, 2024 · 1 comment · Fixed by #137
Closed

typedCallConfig storeResult: false doesnt remove result Prop type #136

gabrielguerrero opened this issue Sep 18, 2024 · 1 comment · Fixed by #137
Labels
bug Something isn't working released signals

Comments

@gabrielguerrero
Copy link
Owner

typeCallConfig is generating the wrong type when storeResult: false, example:

withCalls(() => ({
    loadProductDetail: typedCallConfig({
      call: ({ id }: { id: string }) =>
        inject(ProductService).getProductDetail(id),
      mapPipe: 'switchMap',
      storeResult: false,
    }),
    checkout: () => inject(OrderService).checkout(),
  })),
 

The resulting store will still have loadProductDetailResult, even though it will not be populated when the response is received
Also, if storeResult: false is present, it should not allow defining a resultProp.

Workaround: not using typeCallConding , passing the object directly with storeResult: false correctly removes the type, but has the usual problems of not using the typedCallConfig, like loosing the types in callbacks like onSuccess

Copy link

🎉 This issue has been resolved in version 18.2.1 🎉

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
bug Something isn't working released signals
Projects
None yet
1 participant