Skip to content

Vanilla subscribe does not trigger when a computed getter is updated #742

Discussion options

You must be logged in to vote
let lastObjectSnap
subscribe(store, () => {
  const currentObjectSnap = snapshot(store.currentObject);
  if (lastObjectSnap !== currentObjectSnap) {
    lastObjectSnap = currentObjectSnap
    // do your stuff
  }
})

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dai-shi
Comment options

Answer selected by sharathprabhal
@sharathprabhal
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants