liftSignal
G
W
"Lifts" methods from a signal's value to the signal itself just by passing a tuple of method names. The lifted methods should be those appropriate for mutating or updating the value. For example, lifting Array.push will add a method called push to the signal. Calling the push method will internally call signal.update() with a function that executes the push and returns the updated signal.
Warning
Signals and mutation don't mix. In order for mutators to work, objects are cloned either with Object.Assign or structuredClone so that a new object is actually created with every call. A new clone method can be specified if a more specific method is required.
Lift methods from an array directly to signal
You can easily lift the methods on from any object to the signal. Here various array methods are lifted and directly accessed.
Array Value
[
23,
90,
96
]