Skip to content

Instantly share code, notes, and snippets.

@qkreltms
Created April 18, 2021 08:35
Show Gist options
  • Save qkreltms/093a1ad26c1f6d79ceeeeb40eb09998a to your computer and use it in GitHub Desktop.
Save qkreltms/093a1ad26c1f6d79ceeeeb40eb09998a to your computer and use it in GitHub Desktop.
const update = (state: Object) => {
    // add any changed keys to the queue
    Object.keys(state).forEach(key => {
      if (!passWhitelistBlacklist(key)) return // is keyspace ignored? noop
      if (lastState[key] === state[key]) return // value unchanged? noop
      if (keysToProcess.indexOf(key) !== -1) return // is key already queued? noop
      keysToProcess.push(key) // add key to queue
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment