ngrx

Multiple stores in ngrx

时光怂恿深爱的人放手 提交于 2020-08-22 09:38:42
问题 I am writing an enterprise-scale application with Angular and ngrx. The intention is to use Flux and ngrx throughout. For reuse and separability we require (at least) two state stores that do not interact with each other. But we do need both stores to be active at the same time, and potentially accessed from the same components. Ngrx seems to be predicated on the assumption that there will only ever be one Store at once. Is there an approach that will allow me to have multiple Store objects

Multiple stores in ngrx

末鹿安然 提交于 2020-08-22 09:38:05
问题 I am writing an enterprise-scale application with Angular and ngrx. The intention is to use Flux and ngrx throughout. For reuse and separability we require (at least) two state stores that do not interact with each other. But we do need both stores to be active at the same time, and potentially accessed from the same components. Ngrx seems to be predicated on the assumption that there will only ever be one Store at once. Is there an approach that will allow me to have multiple Store objects

Is @ngrx/store a hot or cold observable?

回眸只為那壹抹淺笑 提交于 2020-08-08 12:27:25
问题 I think that it is a cold observable (as is the default) but couldn't find a reference to it either in the code or the documentation. (Sorry if this is asked already, couldn't find something) 回答1: ;TLDR It's a hot observable because both ActionSubject and ReducerManager extend BehaviorSubject which is a hot observable. As stated in the diagram at https://ngrx.io/guide/store The store receives events from Actions, and Actions are processed via Reducers. Both ActionSubject (the observable of

Is @ngrx/store a hot or cold observable?

狂风中的少年 提交于 2020-08-08 12:25:23
问题 I think that it is a cold observable (as is the default) but couldn't find a reference to it either in the code or the documentation. (Sorry if this is asked already, couldn't find something) 回答1: ;TLDR It's a hot observable because both ActionSubject and ReducerManager extend BehaviorSubject which is a hot observable. As stated in the diagram at https://ngrx.io/guide/store The store receives events from Actions, and Actions are processed via Reducers. Both ActionSubject (the observable of

Is @ngrx/store a hot or cold observable?

▼魔方 西西 提交于 2020-08-08 12:24:14
问题 I think that it is a cold observable (as is the default) but couldn't find a reference to it either in the code or the documentation. (Sorry if this is asked already, couldn't find something) 回答1: ;TLDR It's a hot observable because both ActionSubject and ReducerManager extend BehaviorSubject which is a hot observable. As stated in the diagram at https://ngrx.io/guide/store The store receives events from Actions, and Actions are processed via Reducers. Both ActionSubject (the observable of

Difference in performance between ngrx and ngxs?

眉间皱痕 提交于 2020-07-18 03:31:11
问题 I want to use ngxs for state management in my Angular 6 application. But I am not sure if it is mature for big projects. I can not find any articles about Difference in performance between ngrx and ngxs. Can someone provide some info about it? Performance metrics: Getting a large number of items form the store and writing back into the store. 回答1: Here is good answer from Reddit (Angular2+ community). It's from a developer who tested both and switched to NGXS. I would like to share my

Difference in performance between ngrx and ngxs?

给你一囗甜甜゛ 提交于 2020-07-18 03:31:10
问题 I want to use ngxs for state management in my Angular 6 application. But I am not sure if it is mature for big projects. I can not find any articles about Difference in performance between ngrx and ngxs. Can someone provide some info about it? Performance metrics: Getting a large number of items form the store and writing back into the store. 回答1: Here is good answer from Reddit (Angular2+ community). It's from a developer who tested both and switched to NGXS. I would like to share my

Testing fail action - marble - ngrx Effects

Deadly 提交于 2020-06-28 05:17:37
问题 I've got an issue testing a failed action on my effects. To give a bit of context here loadProducts effect is executed when the Load action is called. Inside the effect an HTTP request is performed, in case this request is executed successfully the LoadSuccess action is called, otherwise LoadFail is called. Code here bellow @Effect() loadProducts$ = this.actions$.pipe( ofType(productActions.ProductActionTypes.Load), mergeMap((action: productActions.Load) => this.productService.getProducts()

How to stop a subscription after the response to a service/store has a certain argument/value [duplicate]

浪子不回头ぞ 提交于 2020-06-17 15:57:07
问题 This question already has answers here : Close subscription on condition with takeUntil() (2 answers) Closed 10 months ago . I have, say a service, or a store selector, to be more accurate, that returns an object that changes after some time (returns a different object). But the thing is, I want to unsubscribe from this service after this object has a certain property in it, or (later) if a property has a certain value to it. I know i'ts usual to use the takeUntil function from 'rxjs', i've

How to fix ngrx store throwing error while testing?

心不动则不痛 提交于 2020-06-01 05:12:07
问题 I'm using ngrx/store for managing the state of my app. I'm using jest & jest-marbles for testing the app. But while doing testing I'm not being able to run the test suite properly. I'm getting the following error while running tests with ngrx/store/testing. How can I rectify this error? I've inspected the path 'D:\my-app\node_modules\@ngrx\store\bundles\store-testing.umd.js'. This file already exists. But still the test is spitting this error. Could not find source file: 'D:\my-app\node