michaelcontento / redux-storage

Persistence layer for redux with flexible backends
MIT License
675 stars 50 forks source link

Blacklist and whitelist not working #131

Closed helgefredheim closed 8 years ago

helgefredheim commented 8 years ago

I struggle making whitelist and blacklist working.

I understand the arrays passed to storage.createEngine should be objects with a type attribute. However, when I pass this like so:

const middleware = storage.createMiddleware(engine, [], [{type: "MY_ONLY_ACTION_TO_BE_SAVED"}]

nothing happens when I dispatch an action with that type.

If I don't pass anything, it saves the full state tree to the key I've provided to the engine I'm using. I currently use redux-storage-engine-localstorage.

Any idea why?

michaelcontento commented 8 years ago

Yes, you to decorate the engine with redux-storage-decorator-filter for black- and/or whitelisting 😄