[Angular] Ngrx/effects, Action trigger another action
@Injectable()
export class LoadUserThreadsEffectService { constructor(private action$: Actions, private threadsService: ThreadsService) {
} @Effect()
userThreadsEffect$: Observable<Action> = this.action$
.ofType(LOAD_USER_THREADS_ACTION)
.switchMap((action) => this.threadsService.loadUserThreads(action.payload))
.map((allUserData) => new LoadUserThreadsSuccess(allUserData)); @Effect()
userSelectedEffect$: Observable<Action> = this.action$
.ofType(USER_SELECTED_ACTION)
.map((action) => new LoadUserThreadsAction(action.payload))
}
For the first Effect,
LOAD_USER_THREADS_ACTION
will trigger another action:
.map((allUserData) => new LoadUserThreadsSuccess(allUserData));
Second effect:
.ofType(USER_SELECTED_ACTION)
will trigger another action:
.map((action) => new LoadUserThreadsAction(action.payload))
[Angular] Ngrx/effects, Action trigger another action的更多相关文章
- [Angular] Improve Server Communication in Ngrx Effects with NX Data Persistence in Angular
Communicating with a remote server via HTTP presents an extra level of complexity as there is an inc ...
- 深入理解MVVM模式中Silverlight的Trigger、Action和Behavior及Silverlight的继承机制
接触Silverlight已经有两三个月了,开始一直感觉他和Winform很相似,拖拖控件就行了,所以一直把经历放在了研究后台和服务器交互和性能优化上面,很少去仔细研究Silverlight的页面.前 ...
- ngRx 官方示例分析 - 2. Action 管理
我们从 Action 名称开始. 解决 Action 名称冲突问题 在 ngRx 中,不同的 Action 需要一个 Action Type 进行区分,一般来说,这个 Action Type 是一个字 ...
- [Angular2] @Ngrx/store and @Ngrx/effects learning note
Just sharing the learning experience related to @ngrx/store and @ngrx/effects. In my personal opinio ...
- [Angular] NgRx/effect, why to use it?
See the current implementaion of code, we have a smart component, and inside the smart component we ...
- struct2的structs.xml文件配置There is no Action mapped for action name 问题
很久没写过博客,今天重新开始写,新技术太多,只有通过博客才可以不断积累,本人水平有限,如有错误,欢迎指正,谢谢 今天在MAVEN上配置web project的struct2,发现自己忽略了很多问题,再 ...
- [Microsoft Dynamics CRM 2016]Invalid Action – The selected action was not valid 错误的诱因及解决方法
详细问题描述: 由于解决windows server 评估版过期\SQL server 评估版过期的问题后而导致的Invalid Action – The selected action was no ...
- There is no Action mapped for namespace [/pages/action/student] and action name [findStudent]
1.错误描写叙述 2014-7-13 2:38:54 org.apache.jasper.compiler.TldLocationsCache tldScanJar 信息: At least one ...
- 实现Action(含Action访问ServletAPI)
Action里是否包含实例变量不重要,重要的是包含setter和getter方法. Action可用于封装请求参数和处理结果.jsp中使用struts2输出:<s:property value= ...
随机推荐
- CTF加密题型解析:RSA算法的CTF解法之一
RSA介绍 根据加密原理,可以将大部分的加密算法分为两大类:对称加密算法和非对称加密算法.对称加密算法的加密和解密采用的是同一套算法规则.而非对称加密算法加密时用的是公钥(公开给所有人),解密时用的是 ...
- tomcat做成windows服务之后使用JMX监控的问题
转载:http://blog.chinaunix.net/uid-20449851-id-2369842.html
- PHP服务器环境打开配置文件
MAC 1. cd /usr/local/etc/nginx/servers vim www.xxx.com 2. 在/usr/local/etc/nginx/servers目录下,不同的 .con ...
- Dotfuscator use for .net4.0 error solve
在混淆的时候报错了,错误描述大致如下: Could not find a compatible version of ildasm to run on assembly C:\xxx.dll This ...
- Hypervisor, computer system, and virtual processor scheduling method
A hypervisor calculates the total number of processor cycles (the number of processor cycles of one ...
- Java对ad操作
转载:http://blog.csdn.net/binyao02123202/article/details/18697953
- hdu5384 AC自己主动机模板题,统计模式串在给定串中出现的个数
http://acm.hdu.edu.cn/showproblem.php?pid=5384 Problem Description Danganronpa is a video game franc ...
- js进阶 13-6 jquery动画效果相关常用函数有哪些
js进阶 13-6 jquery动画效果相关常用函数有哪些 一.总结 一句话总结:animate(),stop(),finish(),delat()四个. 1.stop()方法的基本用法是什么(sto ...
- Centos minimal 安装桌面
yum update yum groupinstall -y 'X Window System' yum groupinstall -y 'Desktop' #中文支持 yum groupinstal ...
- 【习题 3-9 UVA - 10340】All in All
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 相当于让你判断s1是不是s2的子序列. for一遍就好 [代码] #include <bits/stdc++.h> us ...