gabrielguerrero / ngrx-traits

NGRX Traits is a library to help you compose and reuse state logic in your angular app. There is two versions, @ngrx-traits/signals supports ngrx-signals, and @ngrx-traits/{core, common} supports ngrx.
MIT License
44 stars 3 forks source link

withCalls typedCallConfig that has a no resultProp and a call with no parameters doesnt generate the correct types #74

Closed gabrielguerrero closed 1 month ago

gabrielguerrero commented 1 month ago

The following code should generate a property called testCallResult but it doesn't, and also damages the previous function types removing them from the store.

const Store = signalStore( withState({ foo: 'bar' }), withCalls((store) => ({ testCall: typedCallConfig({ call: () => { return of(true); }, onSuccess: (result) => { // patchState should be able to update the store inside onSuccess patchState(store, { foo: result }); }, onError, }), })), ); As a workaround you can omit using typedCallConfig and use an object for the config but that loses the type for the result on the onSuccess method

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 17.3.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: