You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
…o resultProp and no params call
Fixed bug that was making withCalls lose types when a typeCallConfig had a call with no params and
no resultProp
fix#74
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
The text was updated successfully, but these errors were encountered: