You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/effects/README.md
+24-30
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,16 @@ RxJS powered side effect model for @ngrx/store
4
4
5
5
@ngrx/effects provides an API to model event sources as actions. Effects:
6
6
7
-
- Listen for actions dispatched from @ngrx/store
8
-
- Isolate side effects from components, allowing for more _pure_ components that select state and dispatch actions
9
-
- Provide [new sources](https://martinfowler.com/eaaDev/EventSourcing.html) of actions to reduce state based on external interactions such as network requests, web socket messages and time-based events.
7
+
* Listen for actions dispatched from @ngrx/store
8
+
* Isolate side effects from components, allowing for more _pure_ components that select state and dispatch actions
9
+
* Provide [new sources](https://martinfowler.com/eaaDev/EventSourcing.html) of actions to reduce state based on external interactions such as network requests, web socket messages and time-based events.
10
10
11
11
### Installation
12
+
12
13
Install @ngrx/effects from npm:
13
14
14
15
`npm install @ngrx/effects --save` OR `yarn add @ngrx/effects`
15
16
16
-
17
17
### Nightly builds
18
18
19
19
`npm install github:ngrx/effects-builds` OR `yarn add github:ngrx/effects-builds`
@@ -28,27 +28,28 @@ The `@Effect()` decorator provides metadata to register observable side-effects
28
28
29
29
### Actions Observable
30
30
31
-
- Represents an observable of all actions dispatched to the store.
32
-
- Emits the latest action _after_ the action has passed through all reducers.
33
-
- The `ofType` operator lets you filter for actions of a certain type in which you want to use to perform a side effect.
31
+
* Represents an observable of all actions dispatched to the store.
32
+
* Emits the latest action _after_ the action has passed through all reducers.
33
+
* The `ofType` operator lets you filter for actions of a certain type in which you want to use to perform a side effect.
34
34
35
35
## Example
36
-
1. Create an AuthEffects service that describes a source of login actions:
36
+
37
+
1. Create an AuthEffects service that describes a source of login actions:
Registers @ngrx/effects services to run with your feature modules.
25
23
26
24
**Note**: Running an effects class multiple times, either by `forRoot()` or `forFeature()`, (for example via different lazy loaded modules) will not cause Effects to run multiple times. There is no functional difference between effects loaded by `forRoot()` and `forFeature()`; the important difference between the functions is that `forRoot()` sets up the providers required for effects.
Copy file name to clipboardExpand all lines: docs/effects/testing.md
+5-1
Original file line number
Diff line number
Diff line change
@@ -3,18 +3,20 @@
3
3
## @ngrx/effects/testing
4
4
5
5
### provideMockActions
6
+
6
7
Provides a mock test provider of the `Actions` Observable for testing effects. This works well with writing
7
8
marble tests and tests using the `subscribe` method on an Observable. The mock Actions will deliver a new Observable to subscribe to for each test.
8
9
9
10
Details on marble tests and their syntax, as shown in the `hot` and `cold` methods, can be found in [Writing Marble Tests](https://github.com/ReactiveX/rxjs/blob/master/doc/writing-marble-tests.md).
0 commit comments