usePausableEffect

A React Hook like React.useEffect, but pausable.

Demo

Try to increase the dep counter when effect in different states.

Source
isEffectActive:
true
Dep count:
0
Count (inc via effect):
0

Usage

See API for more details.

Source

Click links below to view source on GitHub.

API

const pausable = usePausableEffect(callback, deps)

Callback

Same as React.useEffect.

Deps

Same as React.useEffect.

Returns

Retuerns contain Pausable instance that can be paused, resumed.

See Pausable for more details.

A Pausable instance.