hooks
hooks copied to clipboard
feat(useEventBus): support-new-way-publish-subscribe
🤔 This is a New feature
🔗 Related issue link
#2533
💡 Background and solution
📝 Changelog
Language | Changelog |
---|---|
🇺🇸 English | |
🇨🇳 Chinese |
☑️ Self Check before Merge
⚠️ Please check all items below before review. ⚠️
- [x] Doc is updated/provided or not needed
- [x] Demo is updated/provided or not needed
- [x] TypeScript definition is updated/provided or not needed
- [x] Changelog is provided or not needed
#2533
新hook基于老的hook主要有以下几点 1.支持一对一发布订阅 2.支持订阅方法里使用state.通过依赖项保证值的最新 3.支持asyncEmit 等待一些异步方法 4.拆分原始类,支持hook方式使用 和 不在函数组件内订阅发布方法.例如utils.js内使用.