selectObserve<S> method
SignalsWatch<S>
selectObserve<S>(
- S selector(
- dynamic
- Widget builder(
- S
- Key? key,
- void onInit(
- S value
- Function? onValueUpdated,
- void onAfterBuild(
- S value
- void onDispose(
- S value
- bool shouldRebuild(
- S newValue,
- S oldValue
- bool shouldNotify(
- S newValue,
- S oldValue
- bool equals(
- S a,
- S b
- Duration? debounce,
- Duration? throttle,
- void onError(
- Object error,
- StackTrace stack
- Widget errorBuilder(
- Object error
- Widget loadingBuilder()?,
- String? debugLabel,
- bool debugPrint = false,
Select a specific part of this signal's value and only rebuild when that part changes.
Example:
final user = SignalsWatch.signal(User(name: 'John', age: 25));
// Only rebuilds when age changes, ignores name changes
user.selectObserve(
(user) => user.age,
(age) => Text('Age: $age'),
)
Implementation
SignalsWatch<S> selectObserve<S>(
S Function(dynamic) selector,
Widget Function(S) builder, {
Key? key,
void Function(S value)? onInit,
Function? onValueUpdated,
void Function(S value)? onAfterBuild,
void Function(S value)? onDispose,
bool Function(S newValue, S oldValue)? shouldRebuild,
bool Function(S newValue, S oldValue)? shouldNotify,
bool Function(S a, S b)? equals,
Duration? debounce,
Duration? throttle,
void Function(Object error, StackTrace stack)? onError,
Widget Function(Object error)? errorBuilder,
Widget Function()? loadingBuilder,
String? debugLabel,
bool debugPrint = false,
}) {
return SignalsWatch<S>.select(
this,
selector: selector,
key: key,
builder: builder,
onInit: onInit,
onValueUpdated: onValueUpdated,
onAfterBuild: onAfterBuild,
onDispose: onDispose,
shouldRebuild: shouldRebuild,
shouldNotify: shouldNotify,
equals: equals,
debounce: debounce,
throttle: throttle,
onError: onError,
errorBuilder: errorBuilder,
loadingBuilder: loadingBuilder,
debugLabel: debugLabel,
debugPrint: debugPrint,
);
}