If i understand correctly:
You want to reset the store and the state feature to there initial values?
You can add to your StoreFeature
a Reset()
method that will set the state to it's initial values
export function withMySignalState() {
return signalStoreFeature(
withState(additionalStates),
WithMethods(store=>({
reset():void{
patchState(store,additonalStates);
}
}))
And in the store just
export const MyStore = signalStore(
{ providedIn: 'root' },
withState(initialValues4Store),
withMySignalState(),
WithMethods(()=>({
resetStore():void{
patchState(store,initialValues4Store);
reset()://comes from the store feature
}
}))