API Reference / @gtkx/react / index / useSignal
Function: useSignal()
useSignal<
T,S>(object,signal,handler,options?):void
Defined in: hooks/use-signal.d.ts:29
Connects a handler to a GObject signal for the lifetime of the component, reconnecting when the object changes.
Each emission runs the handler from the latest committed render, so it does not have to be stable and a changing handler never reconnects the signal.
Type Parameters
T
T extends Object
S
S extends string
Parameters
object
RefProp<T>
signal
S
The signal name, optionally with a ::detail suffix.
handler
TypedSignalHandler<T, S>
options?
UseSignalOptions
isAfter runs the handler after the default handler; isImmediate also invokes it on connect.
Returns
void