Skip to content

修复了once退订bug,将isFunction和useTypedEventValue 改为现代写法#2

Open
chiba233 wants to merge 4 commits into
Misaka-0x447f:mainfrom
chiba233:main
Open

修复了once退订bug,将isFunction和useTypedEventValue 改为现代写法#2
chiba233 wants to merge 4 commits into
Misaka-0x447f:mainfrom
chiba233:main

Conversation

@chiba233

Copy link
Copy Markdown

useTypedEventValue现在ssr安全了
类型收紧UseTypedEventValueResult现在下游需要做undefined判断否则会推导错误 isFunction更现代
修复了once()会漏内粗内存的问题
修复了 const history: T[] = initialValue ? [initialValue] : []; 对 0 / false / '' 等 falsy 值判断错误的问题 把 dispatch 里的 map 改成了 forEach
狠狠收紧类型,类型几乎可推导

useTypedEventValue现在ssr安全了
类型收紧UseTypedEventValueResult现在下游需要做undefined判断否则会推导错误
isFunction更现代
修复了once()会漏内粗内存的问题
修复了 const history: T[] = initialValue ? [initialValue] : []; 对 0 / false / '' 等 falsy 值判断错误的问题
把 dispatch 里的 map 改成了 forEach
狠狠收紧类型,类型几乎可推导
Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
Comment thread src/index.ts Outdated
Comment thread src/react.ts Outdated
@chiba233 chiba233 changed the title 这次是major更新,因为useTypedEventValue在未做undefined处理时会类型错误 修复了once退订bug,将isFunction和useTypedEventValue 改为现代写法 Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants