-
Notifications
You must be signed in to change notification settings - Fork 9
feat(useSignal): refactor useSignal to use useSyncExternalState #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Preview is ready. |
6a6b48d to
587578c
Compare
| return { | ||
| ...options, | ||
| }; | ||
| }, [options.frameInterval, options.frameTimeout, options.priority]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Options here and below are optional. It's better to add question marks here, otherwise it will be an error that options are undefined.
Actual for: useSchedulerDebounce, useSchedulerThrottle, useScheduledTask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a mistake - options should be required
| return state.block.$geometry.subscribe(() => { | ||
| refreshAnchorPosition(); | ||
| }); | ||
| }, [state.block]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think here same? State may be undefined.
Maybe state?.block.
| }); | ||
| }, [viewState]); | ||
|
|
||
| const containerClassNames = useMemo(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Think we can do without usememo here.
Nevertheless, of course, it's easier to read this way, I agree.
feat: add hooks to compute/effect signal feat: add hook to scheduling task feat: add hook to handle scene changes(camera+hitbox)
feat: add hooks to compute/effect signal
feat: add hook to scheduling task
feat: add hook to handle scene changes(camera+hitbox)