psperber / redux-persist-electron-storage

Redux persist adapter for electron-store
52 stars 5 forks source link

Clear storage #10

Closed loopmode closed 4 years ago

loopmode commented 5 years ago

Hi. The module doesn't export a function to clear the storage. How would I go about to implement a "clear" button in my app?

I guess either we could expose the store instance "reset" method.. or should one simply locate the file on the filesystem and delete it?

loopmode commented 4 years ago

I guess currently, the idea is to "simply" reset the store state, implicitly clearing the persisted state as well, right?

psperber commented 4 years ago

Yes, I think the best way would be to feed the initial state to you redux store. I am not sure, if editing the electron store directly can cause more issue then it solves. I will think about it.