Skip to content
Discussion options

You must be logged in to vote

You can use a derived memo:

const [source, setSource] = createSignal(false);
let switchDone = false;
const target = createMemo(() => switchDone || (switchDone = source()));

Update: since source() will only be called off switchDone is false, we can omit untrack.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@danieltroger
Comment options

@danieltroger
Comment options

Answer selected by danieltroger
Comment options

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

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