[RxJS] Marble diagrams in ASCII form
in Form Rxjs ascii
2023-09-14 09:00:53 时间
There are many operators available, and in order to understand them we need to have a simple way of communicating how they transform a source Observable into a result Observable over time. Throughout this course we are going to see the so-called marble diagrams.
var foo = Rx.Observable.interval(1000); /* foo: ---0---1---2---3--... multiplyBy(2) bar: ---0---2---4---6--... */ function multiplyBy(multiplier) { var source = this; var result = Rx.Observable.create(function subscribe(observer) { source.subscribe( function (x) { observer.next(x * multiplier); }, function (err) { observer.error(err); }, function () { observer.complete(); } ); }); return result; } Rx.Observable.prototype.multiplyBy = multiplyBy; var bar = foo.multiplyBy(2); bar.subscribe( function (x) { console.log('next ' + x); }, function (err) { console.log('error ' + err); }, function () { console.log('done'); }, );
相关文章
- ECMAScript原生for-in与for-of的区别
- 内存数据库 mysql-mysql in memory_In-Memory:内存数据库
- ORA-24482: Pool size was less than 1 in shared mode ORACLE 报错 故障修复 远程处理
- ORA-31525: could not find column string in CDC change table string.string ORACLE 报错 故障修复 远程处理
- ORA-32049: duplicate name found in column alias list for WITH clause ORACLE 报错 故障修复 远程处理
- ORA-00374: parameter db_block_size = string invalid ; must be a multiple of string in the range [string..string] ORACLE 报错 故障修复 远程处理
- ORA-01138: database must either be open in this instance or not at all ORACLE 报错 故障修复 远程处理
- ORA-03234: unable to extend index string.string subpartition string by string in tablespace string ORACLE 报错 故障修复 远程处理
- ORA-06917: CMX: error in data read (too many bytes read) ORACLE 报错 故障修复 远程处理
- ORA-07616: $CHANGE_CLASS failed in retrieving the specified device label ORACLE 报错 故障修复 远程处理
- MySQL删除IN操作: 简易指南(mysql删除in)
- BINARY SEARCH in read table statement详解编程语言
- Leetcode(153) Find Minimum in Rotated Sorted Array详解编程语言
- MySQL中的IN运算符技巧(mysql查in)
- 子查询MySQL:实现多条件 IN 子查询(mysql多条件in)
- 查询MySQL中使用IN语句实现多字段查询(mysql多字段in)
- Learn How to Install MySQL Using Wget in 5 Easy Steps(wget安装mysql)
- MySQL中的IN命令:有效管理你的数据库(mysql in 命令)
- MySQL中的“in”与“sum”函数的使用方法解析(mysqlin与sum)
- MySQL中IN的用法和意义(mysql中in的意思)
- MySQL中使用IN子句出现重复值问题的解决方法(mysql中in有重复值)
- Oracle中的IN操作符使用指南(in在oracle)
- Oracle数据库管理实现企业高效运行(in oracle)
- Oracle中列转IN更快更智能的架构方案(oracle中列转列in)
- Oracle in的进步及改善(oracle in的改善)
- 使用Oracle IN多表进行联接查询(oracle in多表)
- Oracle In决定系统新时代的一种转变(oracle in 代表)