useSignal top-level property

_JoltSignalHookCreatorImpl useSignal
final

Creates a reactive signal hook with an initial value.

The signal persists across rebuilds and is automatically disposed when the widget is unmounted.

Parameters:

  • value: The initial value for the signal
  • onDebug: Optional debug callback for reactive system debugging

Returns: A Signal that can be read and written to

Example:

setup(context, props) {
  final count = useSignal(0);
  final name = useSignal('Alice');

  return () => Text('${name.value}: ${count.value}');
}

Implementation

final useSignal = _JoltSignalHookCreatorImpl();