You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the confusing title. To summarize the problem briefly, I want to publish and update multiple useSharedValue values via a single hook. This is how I plan to use store object where I can keep all changes in my editor project for react-native-skia
Example Of usage:
import{SkMatrix,SkMutableValue,SkRect}from"react-native-skia"typeSharedStoreTypes={matrices:[]SkMutableValue<SkMatrix>,//may be contain 1000 itemdimensions:[]SkMutableValue<SkRect>,//may be contain 1000 itemselectionList: matrixes:[]SharedValue<[]string>,//may be contain 1000 item}constuseSharedStore=createSharedStore()// useSharedStore.get()// useSharedStore.set(f=>f.matrices.filter((_,k)=>k!==1))functionuseWatchGestures(){constcanvasMatrix=useSharedStore(f=>f.matrices)}functionuseWatchDimensions(){constcanvasDimensions=useSharedStore(f=>f.dimensions)}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Sorry for the confusing title. To summarize the problem briefly, I want to publish and update multiple useSharedValue values via a single hook. This is how I plan to use store object where I can keep all changes in my editor project for react-native-skia
Example Of usage:
Beta Was this translation helpful? Give feedback.
All reactions