Skip to content

Instantly share code, notes, and snippets.

@rt2zz
Created November 29, 2015 21:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rt2zz/ac9eb396793f95ff3c3b to your computer and use it in GitHub Desktop.
Save rt2zz/ac9eb396793f95ff3c3b to your computer and use it in GitHub Desktop.
disable persistStore in node environment
if (typeof self === 'object') persistStore(store)
@lauterry
Copy link

Hello, can you explain the typeof self === 'object' please ?

Thank you

@stanleycyang
Copy link

@lauterry self is a reference to the window object, which is only available in the client-side. You can refer to this answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment