usePausable

A React Hook that helps to create a Pausable instance.

Demo

Source
isActive:
false

Usage

See API for more details.

Source

Click links below to view source on GitHub.

API

const { isActive, pause, resume } = usePausable(initialStatus)

InitialStatus

A boolean value of the initial internal isActiveRef.current, default to false.

Returns

Retuerns contain Pausable instance that can be paused, resumed.

See Pausable for more details.

A Pausable instance.