Skip to content
Discussion options

You must be logged in to vote

no, it's not supported currently. It is usually enough to depend on referential identity when running an effect or so. If your list of flags is deterministic, you can do:

const { data } = useMyWorkflowQuery()
const { workflowADone, workflowBDone } = data


const aData = React.useMemo(() => worflowADone ? expensiveComputation() : null, [worflowADone, expensiveComputation])
const bData = React.useMemo(() => worflowBDone ? expensiveComputation() : null, [worflowBDone, expensiveComputation])

Otherwise, you'd need to keep track of the previous one yourselves. There is the usePrevious hook which does that via a ref, or, you can just drag the previous result along in your fetchFn, something like:

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lukesmurray
Comment options

Answer selected by lukesmurray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants