-
-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Description
Which @ngneat/elf-* package(s) are relevant/releated to the feature request?
persist-state
Description
Right now to exclude some keys from being saved, you have to do sth like the following:
persistState(store, {
storage: myStateStorage,
source: () => store
.pipe(
map(value => {
const {entities, ids, ...toSave} = value;
return toSave;
})
)
}
);It would be nice if there was a simpler way to specify keys to exclude.
Proposed solution
A simple exclude config would be nice:
persistState(store, {
storage: myStateStorage,
exclude: ['entities', 'ids']
});Alternatives considered
Some custom RxJS operator similar to pluck but taking multiple keys:
persistState(store, {
storage: myStateStorage,
source: () => store
.pipe(
excludeKeys(['entities', 'ids'])
)
}
);PS: I could create a PR but might need some suggestions for the simplest way to achieve this.
Do you want to create a pull request?
Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels