newBarrier()
Deprecated
The newBarrier() function was deprecated in v1.23.9, and removed in v1.24.0. Instead use Barrier constructor directly, i.e.
Before:
import { newBarrier } from '@dr.pogodin/react-utils';
const barrier1 = newBarrier();
const barrier2 = newBarrier().then(() => console.log('OK'));
Now:
import { Barrier } from '@dr.pogodin/react-utils';
const barrier1 = new Barrier();
const barrier2 = new Barrier()
.then(() => console.log('OK'));
Oiginal Documentation
Valid for dr.pogodin/react-utils versions from v0.25.0 up to v1.23.13.
import { newBarrier } from '@dr.pogodin/react-utils';
newBarrier(): Barrier
Creates a new Barrier instances. It is just a syntax sugare which makes this more readable:
const barrier = newBarrier().then(() => console.log('OK'));