Help

Add default / initial value to useSynced

Topic Labels: Custom Extensions
678 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Ronen_Babayoff
7 - App Architect
7 - App Architect

Similar to useState intial state.

Otherwise, there will always be boilerplate code of if value is null then value is initial value:

let [value, setValue, canSetValue] = useSynced('myGlobalConfigKey');
if (value == null) {
  value = 'initialValue';
}

Cheers,
Ronen Babayoff
Superblocks.at

0 Replies 0