coderwhy / coderwhy/hy-event-store
事件总线event三个方法分别用于什么场景?
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 411
- Forks
- 45
- Avg merge
- 1m
- Merged PRs (30d)
- 6
Description
事件总线event三个方法:on,once,off分别用于什么场景?
我在微信小程序中使用,想在切换组件是发送事件,切换可以不生效。
但是:
使用on时,在切换组件会触发多次,会有错误数据;
使用once时,在切换不生效的情况下,无法发送第二次;
使用off时,报错 Cannot read property 'length' of undefined;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the on, once, and off API entry points, then reproduce the component-switching case in a WeChat mini-program. Done means the expected use of each method and the causes of repeated callbacks, the failed second send, and the off error are documented or fixed, with a regression check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100