leoasis / redux-immutable-state-invariant

Redux middleware that detects mutations between and outside redux dispatches. For development use only.
MIT License
937 stars 37 forks source link

File input lastModifiedDate #38

Open AuthorProxy opened 6 years ago

AuthorProxy commented 6 years ago

Maybe add to ignore this case? https://github.com/BBB/dropzone-redux-form-example/issues/5

leoasis commented 6 years ago

I'm sorry, but that looks like a particular case, when this is intended as a general use case. Maybe you can use ignore or isImmutable to make sure this middleware ignores that particular field in your state.

AuthorProxy commented 6 years ago

@leoasis It's not the specific framework case, it is how DOM file API works, as I understand when you store file data at store , input asynchronously update already stored file field lastModifiedDate at the background

leoasis commented 6 years ago

This is still not general enough for a plugin that aims to detect immutability in a generic state managment library like redux. Also, the DOM itself is mutable so you shouldn't be using such objects as part of the state, unless you know what you're doing and know how that works with respect to the optimizations that redux does because of assuming the state is mutable.