【发布时间】:2020-05-30 11:11:51
【问题描述】:
您好,我有这个 NGXS 脚本
@Action(Login)
login(ctx: StateContext<AuthStateModel>, action: Login) {
return this.authService.login(action.payload).pipe(
tap((result: { token: string }) => {
ctx.patchState({
token: result.token,
username: action.payload.username
});
})
);
}
但是,在我的调度订阅中,我得到了整个商店的退货。我只想要需要的东西。有没有办法通过订阅获取令牌和用户名?
最好的问候。
【问题讨论】:
标签: ngxs