So, I'm attempting to clear store after a logout by doing:
persistStore(store, {storage: localForage}).purgeAll()
but am getting the above mentioned error message. What am I overlooking here?
The full error is as follows:
Uncaught TypeError: (0 , _reduxPersist.persistStore)(...).purgeAll is not a function
at Main._this.logOut (http://localhost:7770/static/bundle.js:35911:92)
at HTMLUnknownElement.wrapped (http://localhost:7770/static/bundle.js:62044:29)
at Object.ReactErrorUtils.invokeGuardedCallback (http://localhost:7770/static/bundle.js:33404:16)
at executeDispatch (http://localhost:7770/static/bundle.js:32928:21)
at Object.executeDispatchesInOrder (http://localhost:7770/static/bundle.js:32951:5)
at executeDispatchesAndRelease (http://localhost:7770/static/bundle.js:9908:22)
at executeDispatchesAndReleaseTopLevel (http://localhost:7770/static/bundle.js:9919:10)
at Array.forEach (native)
at forEachAccumulated (http://localhost:7770/static/bundle.js:41655:9)
at Object.processEventQueue (http://localhost:7770/static/bundle.js:10122:7)
at runEventQueueInBatch (http://localhost:7770/static/bundle.js:70186:18)
at Object.handleTopLevel [as _handleTopLevel] (http://localhost:7770/static/bundle.js:70197:5)
at handleTopLevelImpl (http://localhost:7770/static/bundle.js:70279:24)
at ReactDefaultBatchingStrategyTransaction.perform (http://localhost:7770/static/bundle.js:12255:20)
at Object.batchedUpdates (http://localhost:7770/static/bundle.js:70042:26)
at Object.batchedUpdates (http://localhost:7770/static/bundle.js:2541:27)
at dispatchEvent (http://localhost:7770/static/bundle.js:70354:20)
at HTMLDocument.wrapped (http://localhost:7770/static/bundle.js:62044:29)
in v4 purgeAll was removed, instead use purge().
There is also now a static method import { purgeStoredState } from 'redux-persist' if you prefer.
Most helpful comment
in v4
purgeAllwas removed, instead usepurge().There is also now a static method
import { purgeStoredState } from 'redux-persist'if you prefer.