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
Which @ngrx/* package(s) are relevant/related to the feature request?
signals
Information
A createCustomFeature function. An alternative way to create custom feature that has a few differences from signalStoreFeature.
Instead of receiving an array of feature, it should receive a lambda, from input store to a collection of added members.
The added members should be divided into 4 sections: state, props, methods and hooks
Should also allow to pass additional "prefix" string which will be concatinated to all properties.
It will be used like this:
exportfunctionwithMyFeature(){returncreateCustomFeature(store=>{// run some code in injection context, during instantiation of store, using the input store// ...// return a structure of added membersreturn{state: {prop: value,otherProp: otherValue},props: {computedProp: computed(()=>store.x()+store.y())},methods: {doThis: ()=>{...}}}});}
The reason this is required is to support several common use cases with custom features:
Need instance level closure to keep data that is private to the feature
Need to be able to run code on instantiation, that uses the input store
Need to receive a prefix to attach to all added members (current implementation and typing is incredibly complex)
Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
Yes
No
The text was updated successfully, but these errors were encountered:
Which @ngrx/* package(s) are relevant/related to the feature request?
signals
Information
A
createCustomFeature
function. An alternative way to create custom feature that has a few differences fromsignalStoreFeature
.It will be used like this:
The reason this is required is to support several common use cases with custom features:
Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: