当前位置:网站首页>Development skills of rxjs observable custom operator
Development skills of rxjs observable custom operator
2022-07-02 13:46:00 【InfoQ】
import { interval, of } from 'rxjs';
function fancyOperator(source) {
return source;
}
interval(1000)
.pipe(fancyOperator)
.subscribe((value) => console.log(value));



import { interval, Observable } from 'rxjs';
function fancyOperator(source) {
return Observable.create((observer) => {
observer.next('Jerry');
observer.complete();
});
}
interval(1000)
.pipe(fancyOperator)
.subscribe((value) => console.log(value));

import { fromEvent, interval, Observable } from 'rxjs';
import { filter } from 'rxjs/operators';
function filterKey(key) {
return filter((event: KeyboardEvent) => event.key === key);
}
fromEvent(document, 'keyup')
.pipe(filterKey('Enter'))
.subscribe(
(data) => console.log(data) // KeyboardEvent
);










边栏推荐
- 2022 Heilongjiang provincial examination on the writing skills of Application Essays
- Pointer from entry to advanced (1)
- 科技的成就(二十七)
- What are the classifications of SSL certificates? How to choose the appropriate SSL certificate?
- Unity skframework framework (XIX), POI points of interest / information points
- Runhe hi3516 development board openharmony small system and standard system burning
- Verification failed, please check your call back website. You can follow the instructions
- JS逆向之行行查data解密
- Which do you choose between Alibaba P7 with an annual salary of 900000 and deputy department level cadres?
- EasyDSS点播服务分享时间出错如何修改?
猜你喜欢
Solve "sub number integer", "jump happily", "turn on the light"
Bridge of undirected graph
【文档树、设置】字体变小
Node.js通过ODBC访问PostgreSQL数据库
The 29 year old programmer in Shanghai was sentenced to 10 months for "deleting the database and running away" on the day of his resignation!
qt中uic的使用
BeanUtils--浅拷贝--实例/原理
Answer: can the audio be set to on by default during easydss video on demand?
Japan bet on national luck: Web3.0, anyway, is not the first time to fail!
诚邀青年创作者,一起在元宇宙里与投资人、创业者交流人生如何做选择……...
随机推荐
Pattern matching and regular expressions in PostgreSQL - Das
How to explain binary search to my sister? This is really difficult, fan!
Partner cloud form strong upgrade! Pro version, more extraordinary!
Countermeasures for the failure of MMPV billing period caused by negative inventory of materials in SAP mm
不会看器件手册的工程师不是个好厨子
Tupang multi-target tracking! BOT sort: robust correlated multi pedestrian tracking
Professor of Shanghai Jiaotong University: he Yuanjun - bounding box (containment / bounding box)
刚好1000粉丝,记录一下
使用BLoC 构建 Flutter的页面实例
Crowncad (crown CAD), the first fully independent 3D CAD platform based on Cloud Architecture in China
2022零代码/低代码开发白皮书【伙伴云出品】附下载
Halcon extract orange (Orange)
Add sequence number column to query results in MySQL
[OpenGL] notes 29. Advanced lighting (specular highlights)
mac(macos Monterey12.2 m1) 个人使用php开发
BeanUtils--浅拷贝--实例/原理
Gee learning notes 2
Unity skframework framework (XIX), POI points of interest / information points
[技术发展-22]:网络与通信技术的应用与发展快速概览-2- 通信技术
免费SSL证书知多少?免费SSL证书和收费SSL证书的区别