@ngxs/store 3.7.6-dev.master-94b06c2 → 3.7.6-dev.master-f234866
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/ngxs-store.umd.js +91 -39
- package/bundles/ngxs-store.umd.js.map +1 -1
- package/esm2015/src/actions-stream.js +3 -37
- package/esm2015/src/internal/custom-rxjs-subjects.js +81 -0
- package/esm2015/src/internal/state-stream.js +3 -3
- package/esm2015/src/store.js +4 -4
- package/fesm2015/ngxs-store.js +63 -18
- package/fesm2015/ngxs-store.js.map +1 -1
- package/package.json +1 -1
- package/src/actions-stream.d.ts +2 -21
- package/src/internal/custom-rxjs-subjects.d.ts +37 -0
- package/src/internal/state-stream.d.ts +2 -2
package/package.json
CHANGED
package/src/actions-stream.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
3
|
import { InternalNgxsExecutionStrategy } from './execution/internal-ngxs-execution-strategy';
|
|
4
|
+
import { OrderedSubject } from './internal/custom-rxjs-subjects';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
/**
|
|
6
7
|
* Status of a dispatched action
|
|
@@ -16,26 +17,6 @@ export interface ActionContext<T = any> {
|
|
|
16
17
|
action: T;
|
|
17
18
|
error?: Error;
|
|
18
19
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Custom Subject that ensures that subscribers are notified of values in the order that they arrived.
|
|
21
|
-
* A standard Subject does not have this guarantee.
|
|
22
|
-
* For example, given the following code:
|
|
23
|
-
* ```typescript
|
|
24
|
-
* const subject = new Subject<string>();
|
|
25
|
-
subject.subscribe(value => {
|
|
26
|
-
if (value === 'start') subject.next('end');
|
|
27
|
-
});
|
|
28
|
-
subject.subscribe(value => { });
|
|
29
|
-
subject.next('start');
|
|
30
|
-
* ```
|
|
31
|
-
* When `subject` is a standard `Subject<T>` the second subscriber would recieve `end` and then `start`.
|
|
32
|
-
* When `subject` is a `OrderedSubject<T>` the second subscriber would recieve `start` and then `end`.
|
|
33
|
-
*/
|
|
34
|
-
export declare class OrderedSubject<T> extends Subject<T> {
|
|
35
|
-
private _itemQueue;
|
|
36
|
-
private _busyPushingNext;
|
|
37
|
-
next(value?: T): void;
|
|
38
|
-
}
|
|
39
20
|
/**
|
|
40
21
|
* Internal Action stream that is emitted anytime an action is dispatched.
|
|
41
22
|
*/
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Subject, BehaviorSubject } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* Custom Subject that ensures that subscribers are notified of values in the order that they arrived.
|
|
4
|
+
* A standard Subject does not have this guarantee.
|
|
5
|
+
* For example, given the following code:
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const subject = new Subject<string>();
|
|
8
|
+
subject.subscribe(value => {
|
|
9
|
+
if (value === 'start') subject.next('end');
|
|
10
|
+
});
|
|
11
|
+
subject.subscribe(value => { });
|
|
12
|
+
subject.next('start');
|
|
13
|
+
* ```
|
|
14
|
+
* When `subject` is a standard `Subject<T>` the second subscriber would recieve `end` and then `start`.
|
|
15
|
+
* When `subject` is a `OrderedSubject<T>` the second subscriber would recieve `start` and then `end`.
|
|
16
|
+
*/
|
|
17
|
+
export declare class OrderedSubject<T> extends Subject<T> {
|
|
18
|
+
next: (value?: T | undefined) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Custom BehaviorSubject that ensures that subscribers are notified of values in the order that they arrived.
|
|
22
|
+
* A standard BehaviorSubject does not have this guarantee.
|
|
23
|
+
* For example, given the following code:
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const subject = new BehaviorSubject<string>();
|
|
26
|
+
subject.subscribe(value => {
|
|
27
|
+
if (value === 'start') subject.next('end');
|
|
28
|
+
});
|
|
29
|
+
subject.subscribe(value => { });
|
|
30
|
+
subject.next('start');
|
|
31
|
+
* ```
|
|
32
|
+
* When `subject` is a standard `BehaviorSubject<T>` the second subscriber would recieve `end` and then `start`.
|
|
33
|
+
* When `subject` is a `OrderedBehaviorSubject<T>` the second subscriber would recieve `start` and then `end`.
|
|
34
|
+
*/
|
|
35
|
+
export declare class OrderedBehaviorSubject<T> extends BehaviorSubject<T> {
|
|
36
|
+
next: (value: T) => void;
|
|
37
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { OnDestroy } from '@angular/core';
|
|
2
|
-
import { BehaviorSubject } from 'rxjs';
|
|
3
2
|
import { PlainObject } from '@ngxs/store/internals';
|
|
3
|
+
import { OrderedBehaviorSubject } from './custom-rxjs-subjects';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
6
6
|
* BehaviorSubject of the entire state.
|
|
7
7
|
* @ignore
|
|
8
8
|
*/
|
|
9
|
-
export declare class StateStream extends
|
|
9
|
+
export declare class StateStream extends OrderedBehaviorSubject<PlainObject> implements OnDestroy {
|
|
10
10
|
constructor();
|
|
11
11
|
ngOnDestroy(): void;
|
|
12
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<StateStream, never>;
|