threepointone / redux-react-local

local component state via redux
369 stars 21 forks source link

Delete registered key on unpersisted unmount #7

Closed jtadmor closed 8 years ago

jtadmor commented 8 years ago

There may be a good reason I am missing, but if !persist, I think we can omit the key from the reducer registry altogether. Otherwise, in the course of an app that generates many dynamic local state (e.g. a bunch of forms), we end up with a very heavily populated registry, and even if the reducer is just x => x, we end up having to enumerate over every key, run x => x, compare x === x, and move on.

threepointone commented 8 years ago

Good catch, I'd originally not implemented persist, and it still needs a test or two. Many thanks!