call<T> method
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 signaldebug: Optional debug options
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
@defineHook
Signal<T> call<T>(
T value, {
JoltDebugOption? debug,
}) {
return useAutoDispose(() => Signal(value, debug: debug));
}