当前位置:网站首页>Difference between rxjs of() and of ({})
Difference between rxjs of() and of ({})
2022-06-12 18:24:00 【Jerrywang WangZiXi】
I've been doing SAP Spartacus A unit test of e-commerce cloud :

At first I return Yes. of(), Later, I found that the words written like this , The figure below map Anonymous functions within the operator do not trigger .

We can find the reason through one-step debugging :
First, from the current Observable Extract... From the object map The operator . Every one passes pipe Processed Observable object , There is one. Operator quote .
then , Use this Operator call Observable object .

Execution section 28 Line logic :
there this Still point to the original Observable object , and array That is, the input parameter , That is to say, the introduction of of Empty object in {}.
If change to of(), So the first 2 Yes array It's empty , So it won't enter for loop , therefore map Anonymous functions in operators , There will be no chance of implementation :

Every map Operator All maintained a project attribute , Point to map Anonymous function passed in when calling :
Now it's time to execute my anonymous function :
more Jerry The original article of , All in :“ Wang Zixi ”:
边栏推荐
- Self made calculator (1 realized by Boolean logic operation unit and control unit programming)
- VirtualLab基础实验教程-4.单缝衍射
- 同花顺能开户吗,同花顺在APP上可以直接开通券商安全吗
- JS judge palindromes
- Still using Microsoft office, 3 fairy software, are you sure you don't want to try?
- When openharmony meets openeuler
- Mise en œuvre de l'ACL réflexe dans le simulateur Cisco Cisco Packet Tracer
- 面试题总结
- Implementing reflexive ACL in Cisco packet tracker
- HTTP缓存<强缓存与协商缓存>
猜你喜欢

Explanation of core interrupt of Godson processor

When openharmony meets openeuler

Comparison of disk mapping tools for network disk and object cloud storage management

Installation and configuration of window version pytorch entry depth learning environment

es7不使用父子和嵌套关系来实现一对多功能

HTTP缓存<强缓存与协商缓存>

Title 68: there are n integers, so that the previous numbers are moved backward m positions, and the last m numbers become the first m numbers

Review of MySQL (VII): use of tables

C#的变量

Topic 66: input array, exchange the largest element with the first element, exchange the smallest element with the last element, and output array.
随机推荐
Section qemu+gdb
Installation and configuration of window version pytorch entry depth learning environment
Stack in JS (including leetcode examples) < continuous update ~>
Mise en œuvre de l'ACL réflexe dans le simulateur Cisco Cisco Packet Tracer
Machine learning series (5): Naive Bayes
Leetcode 718 longest common substring
Window版本pytorch入门深度学习环境安装与配置
Review of MySQL (V): Joint table query and sub query
Self made calculator (1 realized by Boolean logic operation unit and control unit programming)
01-复杂度
Random talk about redis source code 91
静态内存分配和动态内存分配小结
Pytest automated testing framework (II)
Typescript advanced type (2)
Virtual Lab Basic Experiment tutoriel - 4. Diffraction à fente unique
leetcode 718 最长公共子串
Overall flow chart of kernel interrupt
Typescript type declaration file (III)
Regression analysis based on elasticnetcv
GD32F4xx 与符合DLT645的电能表通信_2