Skip to content

Instantly share code, notes, and snippets.

@qkreltms
Created April 18, 2021 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qkreltms/376a125f3989547fb4b5f1777eae91fd to your computer and use it in GitHub Desktop.
Save qkreltms/376a125f3989547fb4b5f1777eae91fd to your computer and use it in GitHub Desktop.
  // https://github.com/rt2zz/redux-persist/blob/master/src/createPersistoid.js#L110-L115 
  function passWhitelistBlacklist(key) {
    // whitelist에 적은 특정 키 값만 저장을 허용한다.
    if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist')
      return false
    // blacklist에 적은 키 값은 저장을 허용하지 않는다.
    if (blacklist && blacklist.indexOf(key) !== -1) return false
    return true
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment