what purpose does useLiveSignal and useSignalRef have?
#689
-
|
I saw the new signal utils and they are very cool, I am just having trouble understanding what Is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
With const ResizeObserver = () => {
ref = signalRef()
effect(() => {
// If ref changes recreate the observer
})
return props.condition ? <div ref={ref} /> : <span ref={ref} />
}
|
Beta Was this translation helpful? Give feedback.
With
useSignalRefyou can react to therefchanging, so let's say you have the following componentuseLiveSignalis used when the identity of the signal passed to the component can change, as seen in #361 (comment)