6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
+ import stableStringify from 'fast-json-stable-stringify' ;
9
10
import { Observable , Subject , concat , of } from 'rxjs' ;
10
11
import { finalize , ignoreElements , share , shareReplay , tap } from 'rxjs/operators' ;
11
12
import { JsonValue } from '../../json' ;
@@ -18,14 +19,12 @@ import {
18
19
JobOutboundMessageKind ,
19
20
} from './api' ;
20
21
21
- const stableStringify = require ( 'fast-json-stable-stringify' ) ;
22
-
23
22
// eslint-disable-next-line @typescript-eslint/no-namespace
24
23
export namespace strategy {
25
24
export type JobStrategy <
26
25
A extends JsonValue = JsonValue ,
27
26
I extends JsonValue = JsonValue ,
28
- O extends JsonValue = JsonValue
27
+ O extends JsonValue = JsonValue ,
29
28
> = (
30
29
handler : JobHandler < A , I , O > ,
31
30
options ?: Partial < Readonly < JobDescription > > ,
@@ -37,7 +36,7 @@ export namespace strategy {
37
36
export function serialize <
38
37
A extends JsonValue = JsonValue ,
39
38
I extends JsonValue = JsonValue ,
40
- O extends JsonValue = JsonValue
39
+ O extends JsonValue = JsonValue ,
41
40
> ( ) : JobStrategy < A , I , O > {
42
41
let latest : Observable < JobOutboundMessage < O > > = of ( ) ;
43
42
@@ -66,7 +65,7 @@ export namespace strategy {
66
65
export function reuse <
67
66
A extends JsonValue = JsonValue ,
68
67
I extends JsonValue = JsonValue ,
69
- O extends JsonValue = JsonValue
68
+ O extends JsonValue = JsonValue ,
70
69
> ( replayMessages = false ) : JobStrategy < A , I , O > {
71
70
let inboundBus = new Subject < JobInboundMessage < I > > ( ) ;
72
71
let run : Observable < JobOutboundMessage < O > > | null = null ;
@@ -121,7 +120,7 @@ export namespace strategy {
121
120
export function memoize <
122
121
A extends JsonValue = JsonValue ,
123
122
I extends JsonValue = JsonValue ,
124
- O extends JsonValue = JsonValue
123
+ O extends JsonValue = JsonValue ,
125
124
> ( replayMessages = false ) : JobStrategy < A , I , O > {
126
125
const runs = new Map < string , Observable < JobOutboundMessage < O > > > ( ) ;
127
126
0 commit comments