On This Page
scheduleFlush
flush
afterFlush
Flushing Reactions
Flushing triggers all reactive contexts to update with their current value.
See the dedicated tutorial on flushing for more information on how to use.
scheduleFlush
Schedules a flush of all pending reactions.
Async Flush Reactions run using
microtaskqueues which means that they will not immediately occur unlessflushis used.
Syntax
Reaction.scheduleFlush()Usage
import { Reaction } from '@semantic-ui/reactivity';
Reaction.scheduleFlush();flush
Immediately runs all pending reactions.
Syntax
Reaction.flush()Usage
import { Reaction } from '@semantic-ui/reactivity';
Reaction.flush();afterFlush
Schedules a callback to run after the next flush.
Syntax
Reaction.afterFlush(callback)Parameters
| Name | Type | Description |
|---|---|---|
| callback | Function | The function to run after the flush |
Usage
import { Reaction } from '@semantic-ui/reactivity';
Reaction.afterFlush(() => { console.log('Flush completed');});