| 1 |
--- |
| 2 |
subtitle: Custom React Hooks |
| 3 |
--- |
| 4 |
|
| 5 |
The **Dome** framework provides several [React Hooks](https://reactjs.org/docs/hooks-intro.html) |
| 6 |
to ease your developpement process. Here is a summary of them. |
| 7 |
|
| 8 |
- [`useUpdate(evt)`](dome_.html#.useUpdate) to trigger re-rendering on **Dome** events; |
| 9 |
- [`useEvent(emitter,event,callback)`](dome_.html#.useEvent) to trigger callbacks on events; |
| 10 |
- [`useForceUpdate()`](dome_.html#.useForceUpdate) to trigger re-rendering on demand; |
| 11 |
- [`useState(settings,defaultValue)`](dome_.html#.useState) |
| 12 |
similar to `React.useState()` with optional persistent _window_ settings; |
| 13 |
- [`useSwitch(settings,defaultValue)`](dome_.html#.useSwitch) |
| 14 |
similar to `React.useState()` for boolean values with _window_ settings; |
| 15 |
- [`useGlobalSetting(settings,defaultValue)`](dome_.html#.useGlobalSetting) |
| 16 |
similar to `React.useState()` with optional persistent _global_ settings; |
| 17 |
- [`useHistory(settings,defaultValue)`](dome_.html#.useHistory) |
| 18 |
for managing histories |
| 19 |
- [`useClock(period,initStart)`](dome_.html#.useClock) |
| 20 |
returns start/stop clocks synchronized on period. |
| 21 |
- [`useCommand()`](dome_.html#.useCommand) for working with different application instances. |
| 22 |
- See also the [`Dome.State`](dome(renderer).State.html) and the associated hooks. |