Search code examples
redux-persist

What is the recommended way to import PAUSE in redux-persist?


I am using redux-persist.

One way to pause is using:

persistor.pause();

I hope to pause in my epic. What is the recommended way to import PAUSE?

import { PAUSE } from 'redux-persist/lib/constants';
import { PAUSE } from 'redux-persist/es/constants';
import { PAUSE } from 'redux-persist/src/constants';

Solution

  • I got response from the redux-persist's owner Zack Story.

    Right now you can use either of these three.

    import { PAUSE } from 'redux-persist/lib/constants';
    import { PAUSE } from 'redux-persist/es/constants';
    import { PAUSE } from 'redux-persist/src/constants';
    

    In the future, it will be

    import { PAUSE } from 'redux-persist';
    

    Please check here for the update.