useOnce function
void
useOnce(
- void Function()? effect()
Implementation
void useOnce(void Function()? Function() effect) {
useEffect(
() {
final call = effect();
return () => {
if (call != null) call(),
};
},
[],
);
}