当前位置:网站首页>消息的订阅和发布
消息的订阅和发布
2022-07-26 13:36:00 【陈小同学】
下载pubsub-js
npm add pubsub-js
引用
import PubSub from 'pubsub-js'
发布消息
PubSub.publish('消息名称', 数据)
订阅消息
PubSub.subscribe('消息名称', (_, data) =>{
- _ 占位符
- data为数据
...
})
边栏推荐
- Can I take your subdomain? Exploring Same-Site Attacks in the Modern Web
- Comparator (interface between comparable and comparator)
- How to face scientific and technological unemployment?
- HCIP第十二天笔记整理(BGP联邦、选路规则)
- Multi objective optimization series 1 --- explanation of non dominated sorting function of NSGA2
- File upload and download performance test based on the locust framework
- Abstract factory and its improvement examples
- LeetCode 1523. 在区间范围内统计奇数数目
- Detailed relation extraction model casrel
- Research status and pain points of deep learning 3D human posture estimation at home and abroad
猜你喜欢

上一次听到易趣,还是上一次
Control the probability of random winning [C | random]

This article explains the FS file module and path module in nodejs in detail
![[flower carving hands-on] interesting and fun music visualization series small project (13) -- organic rod column lamp](/img/d4/7b9c7c99d46661e1be2963a342dd18.jpg)
[flower carving hands-on] interesting and fun music visualization series small project (13) -- organic rod column lamp

3D modeling and rendering based on B é zier curve

Jenkins 中 shell 脚本执行失败却不自行退出

Unicorn, valued at $1.5 billion, was suddenly laid off, and another track was cold?

Detailed explanation of factory mode

See you tomorrow at the industrial session of cloud intelligence technology forum!

One stroke problem (Chinese postman problem)
随机推荐
Jenkins 中 shell 脚本执行失败却不自行退出
[turn] judge the relationship between two geometries in ArcGIS
Unicode file parsing methods and existing problems
B+ tree index use (6) leftmost principle -- MySQL from entry to proficiency (18)
B+ tree (4) joint index -- MySQL from entry to proficiency (16)
421. 数组中两个数的最大异或值
时间复杂度和空间复杂度
Comparator (interface between comparable and comparator)
How to realize the reality of temporary graphic elements
[oauth2] v. oauth2loginauthenticationfilter
Why do you want to make "secret comments"?
Leetcode 263. ugly number
WPS凭什么拒绝广告?
【黑马早报】字节旗下多款APP下架;三只松鼠脱氧剂泄露致孕妇误食;CBA公司向B站索赔4.06亿;马斯克否认与谷歌创始人妻子有婚外情...
B+ tree index use (8) sorting use and precautions (20)
B+ tree index uses (7) matching column prefix, matching value range (19)
【C语言学习者必会的题目集锦1】巩固基础,稳步提高
Comparison between SIGMOD function and softmax function
Solution 5g technology helps build smart Parks
vector的一些实用操作