Shared States across multiple components.
- useSharedState
- useSharedStateValue
- useSharedStateChange
- getOrSetSharedValue
- setSharedValue
- useSharedState ( Hook 🪝 )
const [value, setValue] = useSharedState<string>(
"key",
"initialValue"
); //second arg is optional
- useSharedStateValue ( Hook 🪝 )
const value = useSharedStateValue<string>(
"key",
"initialValue"
); //second arg is optional
- useSharedStateChange ( Hook 🪝 )
const setValue =
useSharedStateChange<string>("key");
- getOrSetSharedValue ( Function ⚙️ )
const value = getOrSetSharedValue<string>(
"key",
"initialValue"
); //second arg is optional
- setSharedValue ( Function ⚙️ )
const value = setSharedValue<string>(
"key",
"value"
);