useLiveState
HookuseLiveState()
Hook:
If you are familiar with React’s useState()
hook, we have a similar hook called useLiveState()
that can be used to sync data realtime for specific state variables in your code.
Hook syntax:
UNIQUE_ID
-> unique id in string to be synced across the screensINITIAL_VALUE
-> initial value of the stateOPTIONS
(object)
syncDuration
-> debounce duration in milliseconds to sync realtime (optional, default value 50ms)resetLiveState
-> Boolean to reset locatl state value on server side on initiatlize of hook (default: false
)value
-> current state value (similar to useState hook)setValue
-> function to be called to set next value (similar to useState hook)Comment
DOM Change Detection
when users are in Comment Mode
to improve performance.
However, you can turn Comment
DOM Change Detection
back on with the changeDetectionInCommentMode
property.
This will make Comment's
reposition themselves if the DOM happens to change while in Comment Mode
.
Default: false
Comments
in the Sidebar
are ordered in descending order of when they were last updated.
You can change this sorting order with the sort-data
property.
There are three options for sorting:
asc
- to show comments in descendending order of when they were last updateddesc
- to show comments in ascending order of when they were last updatednone
- to show comments in the sequence they were added