Hello, would it be possible to have signal setters take a function, like setState and memo do? I.E.
const [getSignal, setSignal] = createSignal([]);
const push = (val) => setSignal(prev => [...prev, val]);
or something similar?
My gut is worried because it feels to me like doing setSignal([...getSignal(), val]) would open up the potential for some infinite loops, and wrapping getSignal in untracked is a lot of typing... Also, I suppose as most of the other functions can do that, especially setState, it would seem to fit.
Hello, would it be possible to have signal setters take a function, like setState and memo do? I.E.
or something similar?
My gut is worried because it feels to me like doing
setSignal([...getSignal(), val])would open up the potential for some infinite loops, and wrapping getSignal in untracked is a lot of typing... Also, I suppose as most of the other functions can do that, especially setState, it would seem to fit.