ngrx

    3热度

    1回答

    我正在使用服务中定义的虚拟数据创建应用程序。 在一个组分,我有以下功能删除产品: removeItem(productId: string) { this.cartService.removeItem(productId); } 和服务如下: removeItem(productId: string) { const itemIndex = this.cart.

    1热度

    1回答

    我有一个问题,当我试图建立终极版在我Angular4项目中,我使用的代码下面的管理登录操作: @Effect() login$: Observable<Action> = this.act .ofType(actions.LOGIN) .map((action: actions.LoginAction) => action.payload) .switchM

    2热度

    2回答

    作为新ngrx我面临的一个例外,不知道为什么...... 我想dispatch的action并在effect处理它,但我一直收到错误:TypeError: Actions must have a type property 操作: export const TEST_ACTION = 'test_action'; export class TryTest implements Action {

    0热度

    3回答

    我在angular 2 Project中工作并使用ngrx和rxjs技术。 现在我有一个问题: 我试图声明的影响。 效果有http请求,只有当它成功我想调用其他http请求,所以只有当它也成功 - 然后分派成功的行动。 我已经通过抛出一个错误来测试它,但它总是调度行动! 参见: @Effect() createEntity$ = this.actions$.ofType(CREATE_ENTI

    0热度

    2回答

    @effect() public loadAccommodations$: Observable = this.actions$ .ofType(PAA.PROPERTY_LOAD_REQUEST) // .debounce(300) // introducing this mitigates the flood but does not resolve the

    0热度

    1回答

    我正在使用Ngrx 4.03和typeScript 2.5.2。 我已经定义了一个行动,例如: import { Action } from '@ngrx/store'; import { IUser } from '../models'; export const LOGIN_SUCCESS = '[Auth] Login Success'; export const LOGOUT_SU

    0热度

    2回答

    我有几个Effect侦听器需要运行,直到用户注销。因此,我试图执行OnRunEffects。 我user.actions.ts的段是: export const LOAD_USER = '[Users] Load User'; export class LoadUser implements Action { readonly type = LOAD_USER; } expor

    0热度

    1回答

    我正在使用ngrx来维护我的应用程序状态。 我有与它有两种不同的减速器两个不同的模块,效果等 一个是身份验证,另一个是让电影的列表中angularjs4应用。但是,我看到所谓的第二个效果是将全局应用程序状态写入其值。 我该如何预防? 这里是我的身份验证模块的状态定义 import {User} from "../../models/user"; export interface State {

    2热度

    2回答

    这三个点究竟意味着什么,以及为什么我需要它们? export function leadReducer(state: Lead[]= [], action: Action { switch(action.type){ case ADD_LEAD: return [...state, action.payload]; case REMOVE_LEAD:

    2热度

    1回答

    现在我有一个解析器调用的标准服务,并返回一个可观察: return this.someService.getData() .map(data=> data.json()) 我想NGRX效果和存储来取代它。当解析器运行时,我想调用被拦截的requestAction,这会产生http请求。一旦数据返回,我将dataReceivedAction与数据分配为有效载荷。 基本上我想在解析器中