当前位置:网站首页>Usage of rxjs mergemap
Usage of rxjs mergemap
2022-06-27 11:45:00 【InfoQ】
- flatMap yes mergeMap Another name for .
- If only one internal subscription can be activated at a time , Please use switchMap.
- If inside observables The order of launch and subscription is very important , Please use concatMap.
import { fromEvent, of } from 'rxjs';
import { mergeMap, delay } from 'rxjs/operators';
// faking network request for save
const saveLocation = location => {
return of(location).pipe(delay(500));
};
// streams
const click$ = fromEvent(document, 'click');
click$
.pipe(
mergeMap((e: MouseEvent) => {
return saveLocation({
x: e.clientX,
y: e.clientY,
timestamp: Date.now()
});
})
)
// Saved! {x: 98, y: 170, ...}
.subscribe(r => console.log('Saved!', r));




边栏推荐
- C/s architecture
- 杰理之IO 口中断使用注意事项【篇】
- Precautions for use of IO interface interrupt of Jerry [chapter]
- [tcapulusdb knowledge base] Introduction to tcapulusdb system management
- Jerry's constant feeding of dogs will cause frequent switch interruptions leading to timer [chapter]
- 【TcaplusDB知识库】TcaplusDB系统管理介绍
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、解读分析模型
- I.MX6ULL启动方式
- Co jump
- ECMAScript 6(es6)
猜你喜欢

C語言0長度數組的妙用

进程间通信详解

【TcaplusDB知识库】TcaplusDB常规单据介绍

【TcaplusDB知识库】TcaplusDB运维单据介绍
![Jerry's serial port communication serial port receiving IO needs to set digital function [chapter]](/img/d1/5beed6c86c4fdc024c6c9c66fbffb8.png)
Jerry's serial port communication serial port receiving IO needs to set digital function [chapter]

【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍

Detailed explanation of interprocess communication
![[worthy of collection] centos7 installation MySQL complete operation command](/img/23/7c4b69e1abc3a3ceba9b79cebe1c9b.png)
[worthy of collection] centos7 installation MySQL complete operation command

堆-堆排序-TopK

Oracle-分组统计查询
随机推荐
[tcapulusdb knowledge base] Introduction to tcapulusdb general documents
Jerry's adding timer interrupt [chapter]
[tcapulusdb knowledge base] tcapulusdb business data backup introduction
【TcaplusDB知识库】TcaplusDB-tcaplusadmin工具介绍
Open source model library of flying propeller industry: accelerating the development and application of enterprise AI tasks
15+ urban road element segmentation application, this segmentation model is enough!
Redis distributed lock 15 ask, what have you mastered?
“全班29人24人成功读研”冲上热搜!剩下的5个人去哪了?
i.mx6ull(单片机) c语言环境搭建
[tcapulusdb knowledge base] Introduction to tcapulusdb data import
面试突击60:什么情况会导致 MySQL 索引失效?
器审科普:创新医疗器械系列科普——胸骨板产品
2022CISCN华中 Web
NAACL 2022 | TAMT:通过下游任务无关掩码训练搜索可迁移的BERT子网络
Mqtt protocol stack principle and interaction flow chart
How to deploy jupyterlab in methodot?
“互联网+”大赛命题火热对接中 | 一图读懂百度38道命题
R语言使用epiDisplay包的poisgof函数对泊松回归(Poisson Regression)执行拟合优度检验、检验是否存在过度离散问题(overdispersion)
In depth analysis of error solutions and problems in dynamic loading of unity shadow and outline components
Unity Shader学习(一)认识unity shader基本结构