rxjs - 来自不同管道的 RxJs globalState
问题描述
我需要有不同的管道/分支链才能修改一个全局状态。
如何避免在分支内部冒泡全局状态更改事件?
如何改进这种惯用 RxJS 的方法
const globalState = {}
const br_one_step1$ = globalStateChange$.map(modGlobState_br_one_step1)
const br_one_step2$ = br_one_step1$.map(modGlobState_br_one_step2)
const br_one_step3$ = br_one_step2$.map(modGlobState_br_one_step3)
br_one_step3$.subscribe()
const br_two_step1$ = globalStateChange$.map(modGlobState_br_two_step1)
const br_two_step2$ = br_two_step1$.map(modGlobState_br_two_step2)
const br_two_step3$ = br_two_step2$.map(modGlobState_br_two_step3)
br_two_step3$.subscribe()```
解决方案
推荐阅读
- html - Grid 项目导航栏中的 Flexbox 下拉菜单
- python - 这个 shell 脚本行是做什么的?
- python - Pandas - 排除数字列为 NaN 的行
- tensorflow - logits 和标签必须具有相同的形状 ((None, 4, 1, 2) vs (None, 2))
- layout - “isRtlSupported && 1”是什么意思?
- python-3.x - 数据框中的无关数字格式
- powershell - 如何使用 Select-String 从文件中“grep”整行?
- c# - Retrieve a Remote's Default Branch
- sdk - 如何将一维光谱分配给图像堆栈
- java - 如何使用 javac 或 javah 命令在 JNI 头文件中生成结构定义?