SideEffects<T>.onData constructor
SideEffects<T>.onData (
- void data(
- T data
- void initState()?,
- void dispose()?,
Side effect to be called when he state is mutated successfully with data
Implementation
factory SideEffects.onData(
void Function(T data) data, {
void Function()? initState,
void Function()? dispose,
}) {
return SideEffects(
initState: initState,
dispose: dispose,
onSetState: (snap) {
if (snap.hasData) {
data(snap.data as T);
}
},
);
}