taggedjs 2.4.12 → 2.4.16
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/bundle.js +782 -439
- package/bundle.js.map +1 -1
- package/js/Clones.type.d.ts +3 -1
- package/js/Tag.class.d.ts +7 -10
- package/js/Tag.class.js +90 -73
- package/js/Tag.class.js.map +1 -1
- package/js/Tag.utils.d.ts +5 -5
- package/js/Tag.utils.js +1 -1
- package/js/Tag.utils.js.map +1 -1
- package/js/TemplaterResult.class.d.ts +19 -14
- package/js/TemplaterResult.class.js +19 -12
- package/js/TemplaterResult.class.js.map +1 -1
- package/js/alterProps.function.d.ts +2 -0
- package/js/alterProps.function.js +18 -12
- package/js/alterProps.function.js.map +1 -1
- package/js/checkDestroyPrevious.function.d.ts +3 -1
- package/js/checkDestroyPrevious.function.js +27 -11
- package/js/checkDestroyPrevious.function.js.map +1 -1
- package/js/destroyTag.function.js +4 -4
- package/js/destroyTag.function.js.map +1 -1
- package/js/hasTagSupportChanged.function.js +0 -3
- package/js/hasTagSupportChanged.function.js.map +1 -1
- package/js/index.d.ts +1 -2
- package/js/index.js +1 -2
- package/js/index.js.map +1 -1
- package/js/insertAfter.function.d.ts +2 -0
- package/js/insertAfter.function.js +6 -0
- package/js/insertAfter.function.js.map +1 -0
- package/js/interpolateElement.d.ts +3 -2
- package/js/interpolateElement.js +3 -2
- package/js/interpolateElement.js.map +1 -1
- package/js/interpolateTemplate.d.ts +2 -3
- package/js/interpolateTemplate.js +11 -24
- package/js/interpolateTemplate.js.map +1 -1
- package/js/interpolations.js +2 -1
- package/js/interpolations.js.map +1 -1
- package/js/isInstance.d.ts +2 -2
- package/js/isInstance.js.map +1 -1
- package/js/processAttribute.function.d.ts +1 -0
- package/js/processAttribute.function.js +3 -3
- package/js/processAttribute.function.js.map +1 -1
- package/js/processNewValue.function.js +1 -1
- package/js/processNewValue.function.js.map +1 -1
- package/js/processRegularValue.function.d.ts +2 -2
- package/js/processRegularValue.function.js +7 -6
- package/js/processRegularValue.function.js.map +1 -1
- package/js/processSubjectComponent.function.d.ts +4 -3
- package/js/processSubjectComponent.function.js +29 -18
- package/js/processSubjectComponent.function.js.map +1 -1
- package/js/processSubjectValue.function.d.ts +4 -9
- package/js/processSubjectValue.function.js +6 -54
- package/js/processSubjectValue.function.js.map +1 -1
- package/js/processTag.function.d.ts +7 -0
- package/js/processTag.function.js +59 -0
- package/js/processTag.function.js.map +1 -0
- package/js/processTagArray.d.ts +6 -5
- package/js/processTagArray.js +36 -19
- package/js/processTagArray.js.map +1 -1
- package/js/processTagResult.function.d.ts +3 -2
- package/js/processTagResult.function.js +29 -33
- package/js/processTagResult.function.js.map +1 -1
- package/js/render.d.ts +2 -1
- package/js/render.js.map +1 -1
- package/js/renderExistingTag.function.js +4 -3
- package/js/renderExistingTag.function.js.map +1 -1
- package/js/subject/Subject.class.d.ts +24 -0
- package/js/subject/Subject.class.js +103 -0
- package/js/subject/Subject.class.js.map +1 -0
- package/js/subject/Subject.utils.d.ts +27 -0
- package/js/subject/Subject.utils.js +4 -0
- package/js/subject/Subject.utils.js.map +1 -0
- package/js/subject/ValueSubject.d.ts +9 -0
- package/js/{ValueSubject.js → subject/ValueSubject.js} +4 -4
- package/js/subject/ValueSubject.js.map +1 -0
- package/js/subject/combineLatest.function.d.ts +2 -0
- package/js/subject/combineLatest.function.js +24 -0
- package/js/subject/combineLatest.function.js.map +1 -0
- package/js/subject/index.d.ts +4 -0
- package/js/subject/index.js +5 -0
- package/js/subject/index.js.map +1 -0
- package/js/subject/will.functions.d.ts +8 -0
- package/js/subject/will.functions.js +32 -0
- package/js/subject/will.functions.js.map +1 -0
- package/js/tag.d.ts +1 -1
- package/js/tag.js +2 -2
- package/js/tag.js.map +1 -1
- package/js/tagElement.js +1 -1
- package/js/tagElement.js.map +1 -1
- package/js/updateBeforeTemplate.function.d.ts +3 -0
- package/js/updateBeforeTemplate.function.js +16 -0
- package/js/updateBeforeTemplate.function.js.map +1 -0
- package/js/updateExistingTagComponent.function.d.ts +2 -1
- package/js/updateExistingTagComponent.function.js +52 -25
- package/js/updateExistingTagComponent.function.js.map +1 -1
- package/js/updateExistingValue.function.d.ts +3 -2
- package/js/updateExistingValue.function.js +19 -10
- package/js/updateExistingValue.function.js.map +1 -1
- package/package.json +1 -1
- package/js/Subject.d.ts +0 -17
- package/js/Subject.js +0 -47
- package/js/Subject.js.map +0 -1
- package/js/ValueSubject.d.ts +0 -8
- package/js/ValueSubject.js.map +0 -1
- package/js/bindSubjectCallback.function 9.27.33/342/200/257AM.js" +0 -32
- package/js/bindSubjectCallback.function.d 9.27.33/342/200/257AM.ts" +0 -8
- package/js/redrawTag.function.d.ts +0 -5
- package/js/redrawTag.function.js +0 -18
- package/js/redrawTag.function.js.map +0 -1
- package/js/templater.utils.d.ts +0 -37
- package/js/templater.utils.js +0 -118
- package/js/templater.utils.js.map +0 -1
- package/js/updateExistingTag.function.d.ts +0 -4
- package/js/updateExistingTag.function.js +0 -24
- package/js/updateExistingTag.function.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TagArraySubject } from './processTagArray';
|
|
2
2
|
import { TemplaterResult } from './TemplaterResult.class';
|
|
3
|
-
import { Clones } from './Clones.type';
|
|
3
|
+
import { Clones, InsertBefore } from './Clones.type';
|
|
4
4
|
import { Tag } from './Tag.class';
|
|
5
|
-
import { Counts
|
|
5
|
+
import { Counts } from './interpolateTemplate';
|
|
6
6
|
import { DisplaySubject, TagSubject } from './Tag.utils';
|
|
7
|
-
import { ValueSubject } from './ValueSubject';
|
|
7
|
+
import { ValueSubject } from './subject/ValueSubject';
|
|
8
8
|
import { Callback } from './bindSubjectCallback.function';
|
|
9
9
|
type processOptions = {
|
|
10
10
|
forceElement?: boolean;
|
|
@@ -15,12 +15,7 @@ export type ClonesAndPromise = {
|
|
|
15
15
|
};
|
|
16
16
|
export type InterpolateSubject = TagArraySubject | TagSubject | DisplaySubject | ValueSubject<Callback>;
|
|
17
17
|
export declare function processSubjectValue(value: any | TemplaterResult, subject: InterpolateSubject, // could be tag via result.tag
|
|
18
|
-
|
|
18
|
+
insertBefore: InsertBefore, // <template end interpolate /> (will be removed)
|
|
19
19
|
ownerTag: Tag, // owner
|
|
20
20
|
options: processOptions): Clones | undefined;
|
|
21
|
-
/** Could be a regular tag or a component. Both are Tag.class */
|
|
22
|
-
export declare function processTag(tag: Tag, subject: TagSubject, // could be tag via result.tag
|
|
23
|
-
insertBefore: Element | Text | Template, // <template end interpolate /> (will be removed)
|
|
24
|
-
ownerTag: Tag): void;
|
|
25
|
-
export declare function applyFakeTemplater(tag: Tag, ownerTag: Tag, subject: TagSubject): void;
|
|
26
21
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { processSubjectComponent } from './processSubjectComponent.function';
|
|
2
2
|
import { isTagArray, isTagComponent, isTagInstance } from './isInstance';
|
|
3
3
|
import { processTagArray } from './processTagArray';
|
|
4
|
-
import { TagSupport } from './TagSupport.class';
|
|
5
|
-
import { ValueSubject } from './ValueSubject';
|
|
6
4
|
import { processRegularValue } from './processRegularValue.function';
|
|
5
|
+
import { processTag } from './processTag.function';
|
|
7
6
|
var ValueTypes;
|
|
8
7
|
(function (ValueTypes) {
|
|
9
8
|
ValueTypes["tag"] = "tag";
|
|
@@ -24,67 +23,20 @@ function getValueType(value) {
|
|
|
24
23
|
return ValueTypes.value;
|
|
25
24
|
}
|
|
26
25
|
export function processSubjectValue(value, subject, // could be tag via result.tag
|
|
27
|
-
|
|
26
|
+
insertBefore, // <template end interpolate /> (will be removed)
|
|
28
27
|
ownerTag, // owner
|
|
29
28
|
options) {
|
|
30
29
|
const valueType = getValueType(value);
|
|
31
30
|
switch (valueType) {
|
|
32
31
|
case ValueTypes.tag:
|
|
33
|
-
processTag(value, subject,
|
|
32
|
+
processTag(value, subject, insertBefore, ownerTag);
|
|
34
33
|
return;
|
|
35
34
|
case ValueTypes.tagArray:
|
|
36
|
-
return processTagArray(subject, value,
|
|
35
|
+
return processTagArray(subject, value, insertBefore, ownerTag, options);
|
|
37
36
|
case ValueTypes.tagComponent:
|
|
38
|
-
processSubjectComponent(value, subject,
|
|
37
|
+
processSubjectComponent(value, subject, insertBefore, ownerTag, options);
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
|
-
processRegularValue(value, subject,
|
|
42
|
-
}
|
|
43
|
-
/** Could be a regular tag or a component. Both are Tag.class */
|
|
44
|
-
export function processTag(tag, subject, // could be tag via result.tag
|
|
45
|
-
insertBefore, // <template end interpolate /> (will be removed)
|
|
46
|
-
ownerTag) {
|
|
47
|
-
// first time seeing this tag?
|
|
48
|
-
if (!tag.tagSupport) {
|
|
49
|
-
if (!isTagInstance(tag)) {
|
|
50
|
-
throw new Error('issue non-tag here');
|
|
51
|
-
}
|
|
52
|
-
applyFakeTemplater(tag, ownerTag, subject);
|
|
53
|
-
if (ownerTag.childTags.find(x => x === tag)) {
|
|
54
|
-
throw new Error('about to reattach tag already present - 5');
|
|
55
|
-
}
|
|
56
|
-
ownerTag.childTags.push(tag);
|
|
57
|
-
}
|
|
58
|
-
tag.ownerTag = ownerTag;
|
|
59
|
-
subject.template = insertBefore;
|
|
60
|
-
tag.buildBeforeElement(insertBefore, {
|
|
61
|
-
counts: { added: 0, removed: 0 },
|
|
62
|
-
forceElement: true, test: false,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
export function applyFakeTemplater(tag, ownerTag, subject) {
|
|
66
|
-
if (!ownerTag) {
|
|
67
|
-
throw new Error('no owner error');
|
|
68
|
-
}
|
|
69
|
-
const fakeTemplater = getFakeTemplater();
|
|
70
|
-
tag.tagSupport = new TagSupport(ownerTag.tagSupport, fakeTemplater, // the template is provided via html`` call
|
|
71
|
-
subject);
|
|
72
|
-
fakeTemplater.global.oldest = tag;
|
|
73
|
-
fakeTemplater.global.newest = tag;
|
|
74
|
-
fakeTemplater.tagSupport = tag.tagSupport;
|
|
75
|
-
// asking me to render will cause my parent to render
|
|
76
|
-
tag.ownerTag = ownerTag;
|
|
77
|
-
}
|
|
78
|
-
function getFakeTemplater() {
|
|
79
|
-
return {
|
|
80
|
-
global: {
|
|
81
|
-
renderCount: 0,
|
|
82
|
-
providers: [],
|
|
83
|
-
context: {},
|
|
84
|
-
},
|
|
85
|
-
children: new ValueSubject([]), // no children
|
|
86
|
-
props: {},
|
|
87
|
-
isTag: true,
|
|
88
|
-
};
|
|
40
|
+
processRegularValue(value, subject, insertBefore);
|
|
89
41
|
}
|
|
90
42
|
//# sourceMappingURL=processSubjectValue.function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processSubjectValue.function.js","sourceRoot":"","sources":["../ts/processSubjectValue.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,EAAmB,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"processSubjectValue.function.js","sourceRoot":"","sources":["../ts/processSubjectValue.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,EAAmB,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAOpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,IAAK,UAKJ;AALD,WAAK,UAAU;IACb,yBAAW,CAAA;IACX,oCAAsB,CAAA;IACtB,4CAA8B,CAAA;IAC9B,6BAAe,CAAA;AACjB,CAAC,EALI,UAAU,KAAV,UAAU,QAKd;AAED,SAAS,YAAY,CAAC,KAAU;IAC9B,IAAG,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,UAAU,CAAC,YAAY,CAAA;IAChC,CAAC;IAED,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,UAAU,CAAC,GAAG,CAAA;IACvB,CAAC;IAED,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,UAAU,CAAC,QAAQ,CAAA;IAC5B,CAAC;IAED,OAAO,UAAU,CAAC,KAAK,CAAA;AACzB,CAAC;AAcD,MAAM,UAAU,mBAAmB,CACjC,KAA4B,EAC5B,OAA2B,EAAE,8BAA8B;AAC3D,YAA0B,EAAE,iDAAiD;AAC7E,QAAa,EAAE,QAAQ;AACvB,OAAuB;IAEvB,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAErC,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,UAAU,CAAC,GAAG;YACjB,UAAU,CACR,KAAK,EACL,OAAqB,EACrB,YAAY,EACZ,QAAQ,CACT,CAAA;YACD,OAAM;QAER,KAAK,UAAU,CAAC,QAAQ;YACtB,OAAO,eAAe,CACpB,OAA0B,EAC1B,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,OAAO,CACR,CAAA;QAEH,KAAK,UAAU,CAAC,YAAY;YAC1B,uBAAuB,CACrB,KAAwB,EACxB,OAAqB,EACrB,YAAY,EACZ,QAAQ,EACR,OAAO,CACR,CAAA;YACD,OAAM;IACV,CAAC;IAED,mBAAmB,CACjB,KAAK,EACL,OAAyB,EACzB,YAAY,CACb,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { InsertBefore } from './Clones.type';
|
|
2
|
+
import { Tag } from './Tag.class';
|
|
3
|
+
import { TagSubject } from './Tag.utils';
|
|
4
|
+
/** Could be a regular tag or a component. Both are Tag.class */
|
|
5
|
+
export declare function processTag(tag: Tag, subject: TagSubject, // could be tag via result.tag
|
|
6
|
+
insertBefore: InsertBefore, ownerTag: Tag): void;
|
|
7
|
+
export declare function applyFakeTemplater(tag: Tag, ownerTag: Tag, subject: TagSubject): void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isTagInstance } from './isInstance';
|
|
2
|
+
import { TagSupport } from './TagSupport.class';
|
|
3
|
+
import { ValueSubject } from './subject';
|
|
4
|
+
/** Could be a regular tag or a component. Both are Tag.class */
|
|
5
|
+
export function processTag(tag, subject, // could be tag via result.tag
|
|
6
|
+
insertBefore, ownerTag) {
|
|
7
|
+
// first time seeing this tag?
|
|
8
|
+
if (!tag.tagSupport) {
|
|
9
|
+
if (!isTagInstance(tag)) {
|
|
10
|
+
throw new Error('issue non-tag here');
|
|
11
|
+
}
|
|
12
|
+
applyFakeTemplater(tag, ownerTag, subject);
|
|
13
|
+
if (ownerTag.childTags.find(x => x === tag)) {
|
|
14
|
+
throw new Error('about to reattach tag already present - 5');
|
|
15
|
+
}
|
|
16
|
+
ownerTag.childTags.push(tag);
|
|
17
|
+
}
|
|
18
|
+
tag.ownerTag = ownerTag;
|
|
19
|
+
if (insertBefore.tagName !== 'TEMPLATE') {
|
|
20
|
+
throw new Error(`processTag.function.ts - insertBefore is not TEMPLATE ${insertBefore.tagName}`);
|
|
21
|
+
}
|
|
22
|
+
tag.buildBeforeElement(insertBefore, {
|
|
23
|
+
counts: { added: 0, removed: 0 },
|
|
24
|
+
forceElement: true,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export function applyFakeTemplater(tag, ownerTag, subject) {
|
|
28
|
+
if (!ownerTag) {
|
|
29
|
+
throw new Error('no owner error');
|
|
30
|
+
}
|
|
31
|
+
const fakeTemplater = getFakeTemplater();
|
|
32
|
+
tag.tagSupport = new TagSupport(ownerTag.tagSupport, fakeTemplater, // the template is provided via html`` call
|
|
33
|
+
subject);
|
|
34
|
+
fakeTemplater.global.oldest = tag;
|
|
35
|
+
fakeTemplater.global.newest = tag;
|
|
36
|
+
fakeTemplater.tagSupport = tag.tagSupport;
|
|
37
|
+
// asking me to render will cause my parent to render
|
|
38
|
+
tag.ownerTag = ownerTag;
|
|
39
|
+
}
|
|
40
|
+
function getFakeTemplater() {
|
|
41
|
+
return {
|
|
42
|
+
global: {
|
|
43
|
+
renderCount: 0,
|
|
44
|
+
providers: [],
|
|
45
|
+
context: {},
|
|
46
|
+
subscriptions: [],
|
|
47
|
+
deleted: false,
|
|
48
|
+
newestTemplater: {},
|
|
49
|
+
},
|
|
50
|
+
children: new ValueSubject([]), // no children
|
|
51
|
+
props: {},
|
|
52
|
+
isTag: true,
|
|
53
|
+
isTemplater: false,
|
|
54
|
+
tagged: false,
|
|
55
|
+
wrapper: (() => undefined),
|
|
56
|
+
tagSupport: {},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=processTag.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processTag.function.js","sourceRoot":"","sources":["../ts/processTag.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAI5C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAGxC,gEAAgE;AAChE,MAAM,UAAU,UAAU,CACxB,GAAQ,EACR,OAAmB,EAAE,8BAA8B;AACnD,YAA0B,EAC1B,QAAa;IAEb,8BAA8B;IAC9B,IAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;QACnB,IAAG,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAA;QACvC,CAAC;QAED,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;QAE1C,IAAG,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,2CAA2C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I,YAAY,CAAQ,EAAE,CAAC,EAAE,cAAc;QACrD,KAAK,EAAE,EAAW;QAElB,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,SAAS,CAAuB;QAChD,UAAU,EAAE,EAAgB;KACV,CAAA;AACtB,CAAC"}
|
package/js/processTagArray.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { Clones } from './Clones.type';
|
|
1
|
+
import { Clones, InsertBefore } from './Clones.type';
|
|
2
2
|
import { Tag } from './Tag.class';
|
|
3
|
-
import { ValueSubject } from './ValueSubject';
|
|
4
|
-
import { Counts
|
|
3
|
+
import { ValueSubject } from './subject/ValueSubject';
|
|
4
|
+
import { Counts } from './interpolateTemplate';
|
|
5
5
|
export type LastArrayItem = {
|
|
6
6
|
tag: Tag;
|
|
7
7
|
index: number;
|
|
8
8
|
deleted?: boolean;
|
|
9
9
|
};
|
|
10
10
|
export type TagArraySubject = ValueSubject<Tag[]> & {
|
|
11
|
+
insertBefore: InsertBefore;
|
|
12
|
+
placeholder?: Text;
|
|
11
13
|
lastArray?: LastArrayItem[];
|
|
12
|
-
template: Element | Text | Template;
|
|
13
14
|
isChildSubject?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export declare function processTagArray(subject: TagArraySubject, value: Tag[], // arry of Tag classes
|
|
16
|
-
|
|
17
|
+
insertBefore: InsertBefore, // <template end interpolate />
|
|
17
18
|
ownerTag: Tag, options: {
|
|
18
19
|
counts: Counts;
|
|
19
20
|
forceElement?: boolean;
|
package/js/processTagArray.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { ValueSubject } from './ValueSubject';
|
|
1
|
+
import { ValueSubject } from './subject/ValueSubject';
|
|
2
2
|
import { ArrayNoKeyError } from './errors';
|
|
3
3
|
import { destroyArrayTag } from './checkDestroyPrevious.function';
|
|
4
|
-
import { applyFakeTemplater } from './
|
|
4
|
+
import { applyFakeTemplater } from './processTag.function';
|
|
5
5
|
export function processTagArray(subject, value, // arry of Tag classes
|
|
6
|
-
|
|
6
|
+
insertBefore, // <template end interpolate />
|
|
7
7
|
ownerTag, options) {
|
|
8
8
|
const clones = ownerTag.clones; // []
|
|
9
9
|
let lastArray = subject.lastArray = subject.lastArray || [];
|
|
10
|
-
subject.
|
|
10
|
+
if (!subject.placeholder) {
|
|
11
|
+
setPlaceholderElm(insertBefore, subject);
|
|
12
|
+
}
|
|
13
|
+
const runtimeInsertBefore = subject.placeholder; // || insertBefore
|
|
11
14
|
let removed = 0;
|
|
12
15
|
/** 🗑️ remove previous items first */
|
|
13
16
|
lastArray = subject.lastArray = subject.lastArray.filter((item, index) => {
|
|
@@ -15,8 +18,9 @@ ownerTag, options) {
|
|
|
15
18
|
const at = index - removed;
|
|
16
19
|
const lessLength = newLength < at;
|
|
17
20
|
const subTag = value[index - removed];
|
|
18
|
-
const subArrayValue = subTag?.arrayValue;
|
|
19
|
-
const
|
|
21
|
+
const subArrayValue = subTag?.memory.arrayValue;
|
|
22
|
+
const tag = item.tag;
|
|
23
|
+
const destroyItem = lessLength || !areLikeValues(subArrayValue, tag.memory.arrayValue);
|
|
20
24
|
if (destroyItem) {
|
|
21
25
|
const last = lastArray[index];
|
|
22
26
|
const tag = last.tag;
|
|
@@ -28,8 +32,6 @@ ownerTag, options) {
|
|
|
28
32
|
}
|
|
29
33
|
return true;
|
|
30
34
|
});
|
|
31
|
-
// const masterBefore = template || (template as any).clone
|
|
32
|
-
const before = template || subject.value.insertBefore || template.clone;
|
|
33
35
|
value.forEach((subTag, index) => {
|
|
34
36
|
const previous = lastArray[index];
|
|
35
37
|
const previousSupport = previous?.tag.tagSupport;
|
|
@@ -40,8 +42,8 @@ ownerTag, options) {
|
|
|
40
42
|
previousSupport.templater.global.newest = subTag;
|
|
41
43
|
}
|
|
42
44
|
// check for html``.key()
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
+
const keySet = 'arrayValue' in subTag.memory;
|
|
46
|
+
if (!keySet) {
|
|
45
47
|
const details = {
|
|
46
48
|
template: subTag.getTemplate().string,
|
|
47
49
|
array: value,
|
|
@@ -54,23 +56,36 @@ ownerTag, options) {
|
|
|
54
56
|
}
|
|
55
57
|
const couldBeSame = lastArray.length > index;
|
|
56
58
|
if (couldBeSame) {
|
|
57
|
-
const
|
|
59
|
+
const prevSupport = previous.tag.tagSupport;
|
|
60
|
+
const prevGlobal = prevSupport.templater.global;
|
|
61
|
+
const isSame = areLikeValues(previous.tag.memory.arrayValue, subTag.memory.arrayValue);
|
|
58
62
|
if (isSame) {
|
|
59
|
-
subTag.tagSupport = subTag.tagSupport ||
|
|
60
|
-
const oldest =
|
|
63
|
+
subTag.tagSupport = subTag.tagSupport || prevSupport;
|
|
64
|
+
const oldest = prevGlobal.oldest;
|
|
61
65
|
oldest.updateByTag(subTag);
|
|
62
66
|
return [];
|
|
63
67
|
}
|
|
64
|
-
|
|
68
|
+
// TODO: should not get here?
|
|
69
|
+
processAddTagArrayItem(runtimeInsertBefore, subTag, index, options, lastArray);
|
|
65
70
|
throw new Error('item should be back');
|
|
66
71
|
// return [] // removed: item should have been previously deleted and will be added back
|
|
67
72
|
}
|
|
68
|
-
processAddTagArrayItem(
|
|
73
|
+
processAddTagArrayItem(runtimeInsertBefore, subTag, index, options, lastArray);
|
|
69
74
|
ownerTag.childTags.push(subTag);
|
|
70
75
|
});
|
|
71
76
|
return clones;
|
|
72
77
|
}
|
|
73
|
-
function
|
|
78
|
+
function setPlaceholderElm(insertBefore, subject) {
|
|
79
|
+
if (insertBefore.nodeName !== 'TEMPLATE') {
|
|
80
|
+
subject.placeholder = insertBefore;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const placeholder = subject.placeholder = document.createTextNode('');
|
|
84
|
+
const parentNode = insertBefore.parentNode;
|
|
85
|
+
parentNode.insertBefore(placeholder, insertBefore);
|
|
86
|
+
parentNode.removeChild(insertBefore);
|
|
87
|
+
}
|
|
88
|
+
function processAddTagArrayItem(before, subTag, index, options, lastArray) {
|
|
74
89
|
const lastValue = {
|
|
75
90
|
tag: subTag, index
|
|
76
91
|
};
|
|
@@ -80,11 +95,13 @@ function processAddTagArrayItem(before, subTag, index, options, lastArray, test)
|
|
|
80
95
|
added: options.counts.added + index,
|
|
81
96
|
removed: options.counts.removed,
|
|
82
97
|
};
|
|
83
|
-
|
|
84
|
-
if (!lastFirstChild.parentNode) {
|
|
98
|
+
if (!before.parentNode) {
|
|
85
99
|
throw new Error('issue adding array item');
|
|
86
100
|
}
|
|
87
|
-
|
|
101
|
+
const newTempElm = document.createElement('template');
|
|
102
|
+
before.parentNode.insertBefore(newTempElm, before);
|
|
103
|
+
subTag.buildBeforeElement(newTempElm, // before,
|
|
104
|
+
{ counts, forceElement: options.forceElement });
|
|
88
105
|
}
|
|
89
106
|
/** compare two values. If both values are arrays then the items will be compared */
|
|
90
107
|
function areLikeValues(valueA, valueB) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processTagArray.js","sourceRoot":"","sources":["../ts/processTagArray.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"processTagArray.js","sourceRoot":"","sources":["../ts/processTagArray.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAe1D,MAAM,UAAU,eAAe,CAC7B,OAAwB,EACxB,KAAY,EAAE,sBAAsB;AACpC,YAA0B,EAAE,+BAA+B;AAC3D,QAAa,EACb,OAGC;IAED,MAAM,MAAM,GAAW,QAAQ,CAAC,MAAM,CAAA,CAAC,KAAK;IAC5C,IAAI,SAAS,GAAG,O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
import { Counts } from './interpolateTemplate';
|
|
3
3
|
import { TagArraySubject } from './processTagArray';
|
|
4
4
|
import { TagSubject } from './Tag.utils';
|
|
5
|
+
import { InsertBefore } from './Clones.type';
|
|
5
6
|
export declare function processTagResult(tag: Tag, subject: TagArraySubject | TagSubject | Function, // used for recording past and current value
|
|
6
|
-
insertBefore:
|
|
7
|
+
insertBefore: InsertBefore, // <template end interpolate />
|
|
7
8
|
{ counts, forceElement, }: {
|
|
8
9
|
counts: Counts;
|
|
9
10
|
forceElement?: boolean;
|
|
@@ -1,50 +1,46 @@
|
|
|
1
|
-
import { destroyTagMemory } from './destroyTag.function';
|
|
2
1
|
export function processTagResult(tag, subject, // used for recording past and current value
|
|
3
2
|
insertBefore, // <template end interpolate />
|
|
4
3
|
{ counts, forceElement, }) {
|
|
5
4
|
if (!insertBefore.parentNode) {
|
|
6
|
-
throw new Error(
|
|
5
|
+
throw new Error(`before here processTagResult ${insertBefore.nodeName}`);
|
|
7
6
|
}
|
|
8
7
|
// *if appears we already have seen
|
|
9
8
|
const subjectTag = subject;
|
|
10
9
|
const existingTag = subjectTag.tag;
|
|
11
10
|
const previousTag = existingTag?.tagSupport.templater.global.oldest || undefined; // || tag.tagSupport.oldest // subjectTag.tag
|
|
12
11
|
const justUpdate = previousTag; // && !forceElement
|
|
13
|
-
if (previousTag) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const newTag = subject(previousTag.tagSupport);
|
|
21
|
-
previousTag.updateByTag(newTag);
|
|
22
|
-
if (!newTag.tagSupport.templater.global.oldest) {
|
|
23
|
-
throw new Error('maybe 0');
|
|
24
|
-
}
|
|
25
|
-
subjectTag.tag = newTag;
|
|
26
|
-
if (!newTag.hasLiveElements) {
|
|
27
|
-
throw new Error('44444 - 2');
|
|
28
|
-
}
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
previousTag.updateByTag(tag);
|
|
32
|
-
if (!tag.tagSupport.templater.global.oldest) {
|
|
33
|
-
throw new Error('maybe 1');
|
|
34
|
-
}
|
|
35
|
-
subjectTag.tag = tag;
|
|
36
|
-
if (!tag.hasLiveElements) {
|
|
37
|
-
throw new Error('44444 - 3');
|
|
38
|
-
}
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
destroyTagMemory(previousTag, subject);
|
|
42
|
-
throw new Error('585 - think we never get here');
|
|
12
|
+
if (previousTag && justUpdate) {
|
|
13
|
+
/*
|
|
14
|
+
const areLike = previousTag.isLikeTag(tag)
|
|
15
|
+
|
|
16
|
+
// are we just updating an if we already had?
|
|
17
|
+
if(areLike) {
|
|
18
|
+
return processTagResultUpdate(tag, subjectTag, previousTag)
|
|
43
19
|
}
|
|
20
|
+
*/
|
|
21
|
+
return processTagResultUpdate(tag, subjectTag, previousTag);
|
|
44
22
|
}
|
|
23
|
+
/*
|
|
24
|
+
if(insertBefore.nodeName !== 'TEMPLATE') {
|
|
25
|
+
throw new Error(`processTagResult.function.ts insertBefore is not template ${insertBefore.nodeName}`)
|
|
26
|
+
}
|
|
27
|
+
*/
|
|
45
28
|
tag.buildBeforeElement(insertBefore, {
|
|
46
29
|
counts,
|
|
47
|
-
forceElement,
|
|
30
|
+
forceElement,
|
|
48
31
|
});
|
|
49
32
|
}
|
|
33
|
+
function processTagResultUpdate(tag, subject, // used for recording past and current value
|
|
34
|
+
previousTag) {
|
|
35
|
+
// components
|
|
36
|
+
if (subject instanceof Function) {
|
|
37
|
+
const newTag = subject(previousTag.tagSupport);
|
|
38
|
+
previousTag.updateByTag(newTag);
|
|
39
|
+
subject.tag = newTag;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
previousTag.updateByTag(tag);
|
|
43
|
+
subject.tag = tag;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
50
46
|
//# sourceMappingURL=processTagResult.function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processTagResult.function.js","sourceRoot":"","sources":["../ts/processTagResult.function.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"processTagResult.function.js","sourceRoot":"","sources":["../ts/processTagResult.function.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,gBAAgB,CAC9B,GAAQ,EACR,OAAgD,EAAE,4CAA4C;AAC9F,YAA0B,EAAE,+BAA+B;AAC3D,EACE,MAAM,EAAE,YAAY,GAIrB;IAED,IAAG,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,gCAAgC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1E,CAAC;IAED,mCAAmC;IACnC,MAAM,UAAU,GAAG,OAAqB,CAAA;IACxC,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,CAAA;IAClC,MAAM,WAAW,GAAG,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,MAAa,IAAI,SAAS,CAAA,CAAC,6CAA6C;IACrI,MAAM,UAAU,GAAG,WAAW,CAAA,CAAC,mBAAmB;IAElD,IAAG,WAAW,IAAI,UAAU,EAAE,CAAC;QAC7B;;;;;;;UAOE;QACF,OAAO,sBAAsB,CAAC,GAAG,EAAE,UAAU,EAAE,WAAW,CAAC,CAAA;IAC7D,CAAC;IAGD;;;;MAIE;IAEF,GAAG,CAAC,kBAAkB,CAAC,YAAY,EAAE;QACnC,MAAM;QACN,YAAY;KACb,CAAC,CAAA;AACJ,CAAC;AAGD,SAAS,sBAAsB,CAC7B,GAAQ,EACR,OAAmB,EAAE,4CAA4C;AACjE,WAAgB;IAEhB,aAAa;IACb,IAAG,OAAO,YAAY,QAAQ,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAQ,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;QACnD,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QAC/B,OAAO,CAAC,GAAG,GAAG,MAAM,CAAA;QAEpB,OAAM;IACR,CAAC;IAED,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;IAC5B,OAAO,CAAC,GAAG,GAAG,GAAG,CAAA;IAEjB,OAAM;AACR,CAAC"}
|
package/js/render.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { InsertBefore } from "./Clones.type";
|
|
2
|
+
export declare function buildClones(temporary: Element, insertBefore: InsertBefore): ChildNode[];
|
package/js/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../ts/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../ts/render.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CACzB,SAAkB,EAClB,YAA0B;IAE1B,MAAM,MAAM,GAAG,EAAE,CAAA;IACjB,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAwB,CAAA;IAC7D,IAAI,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;IAE7C,OAAO,WAAW,EAAE,CAAC;QACnB,MAAM,eAAe,GAAG,WAAW,CAAC,WAAW,CAAA;QAC/C,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;QACvC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACxB,WAAW,GAAG,eAAe,CAAA;IAC/B,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,YAAY,CACnB,WAAsB,EACtB,YAA0B;IAE1B,MAAM,UAAU,GAAG,YAAY,CAAC,UAAwB,CAAA;IACxD,UAAU,CAAC,YAAY,CACrB,WAAW,EACX,YAAY,CACb,CAAA;AACH,CAAC"}
|
|
@@ -4,7 +4,8 @@ import { isLikeTags } from './isLikeTags.function';
|
|
|
4
4
|
/** Returns true when rendering owner is not needed. Returns false when rendering owner should occur */
|
|
5
5
|
export function renderExistingTag(oldestTag, // existing tag already there
|
|
6
6
|
newTemplater, tagSupport, subject) {
|
|
7
|
-
|
|
7
|
+
const tag = subject.tag;
|
|
8
|
+
newTemplater.global = tag.tagSupport.templater.global;
|
|
8
9
|
if (!oldestTag.hasLiveElements) {
|
|
9
10
|
throw new Error('1080 - should have live elements');
|
|
10
11
|
}
|
|
@@ -17,8 +18,8 @@ newTemplater, tagSupport, subject) {
|
|
|
17
18
|
return latestTag;
|
|
18
19
|
}
|
|
19
20
|
const oldTemplater = tagSupport.templater || newTemplater;
|
|
20
|
-
const
|
|
21
|
-
subject, oldestTag.ownerTag);
|
|
21
|
+
const toRedrawTag = subject.tag || oldTemplater.global.newest || oldTemplater.global.oldest; // hmmmmmm, why not newest?
|
|
22
|
+
const redraw = renderWithSupport(newTemplater.tagSupport, toRedrawTag, subject, oldestTag.ownerTag);
|
|
22
23
|
const oldest = tagSupport.templater.global.oldest || oldestTag;
|
|
23
24
|
redraw.tagSupport.templater.global.oldest = oldest;
|
|
24
25
|
if (isLikeTags(latestTag, redraw)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderExistingTag.function.js","sourceRoot":"","sources":["../ts/renderExistingTag.function.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAmB,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAE5E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,uGAAuG;AACvG,MAAM,UAAU,iBAAiB,CAC/B,SAAc,EAAE,6BAA6B;AAC7C,YAA6B,EAC7B,UAA0B,EAC1B,OAAmB;IAEnB,
|
|
1
|
+
{"version":3,"file":"renderExistingTag.function.js","sourceRoot":"","sources":["../ts/renderExistingTag.function.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAmB,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAE5E,OAAO,EAAE,UAAU,E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CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,GAAG,MAAM,CAAA;QACpB,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OperatorFunction, SubjectLike, SubjectSubscriber, Subscription } from "./Subject.utils";
|
|
2
|
+
export declare class Subject<T> implements SubjectLike<T> {
|
|
3
|
+
value?: T | undefined;
|
|
4
|
+
methods: OperatorFunction<any, any, any>[];
|
|
5
|
+
isSubject: boolean;
|
|
6
|
+
subscribers: SubjectSubscriber<T>[];
|
|
7
|
+
subscribeWith?: (x: SubjectSubscriber<T>) => Subscription;
|
|
8
|
+
constructor(value?: T | undefined);
|
|
9
|
+
subscribe(callback: SubjectSubscriber<T>): Subscription;
|
|
10
|
+
set(value: any): void;
|
|
11
|
+
next: (value: any) => void;
|
|
12
|
+
toPromise(): Promise<T>;
|
|
13
|
+
pipe(): Subject<T>;
|
|
14
|
+
pipe<A, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>): Subject<A>;
|
|
15
|
+
pipe<A, B, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>, op2: OperatorFunction<A, B, RESOLVE>): Subject<B>;
|
|
16
|
+
pipe<A, B, C, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>, op2: OperatorFunction<A, B, RESOLVE>, op3: OperatorFunction<B, C, RESOLVE>): Subject<C>;
|
|
17
|
+
pipe<A, B, C, D, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>, op2: OperatorFunction<A, B, RESOLVE>, op3: OperatorFunction<B, C, RESOLVE>, op4: OperatorFunction<C, D, RESOLVE>): Subject<D>;
|
|
18
|
+
pipe<A, B, C, D, E, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>, op2: OperatorFunction<A, B, RESOLVE>, op3: OperatorFunction<B, C, RESOLVE>, op4: OperatorFunction<C, D, RESOLVE>, op5: OperatorFunction<D, E, RESOLVE>): Subject<E>;
|
|
19
|
+
pipe<A, B, C, D, E, F, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>, op2: OperatorFunction<A, B, RESOLVE>, op3: OperatorFunction<B, C, RESOLVE>, op4: OperatorFunction<C, D, RESOLVE>, op5: OperatorFunction<D, E, RESOLVE>, op6: OperatorFunction<E, F, RESOLVE>): Subject<F>;
|
|
20
|
+
pipe<A, B, C, D, E, F, G, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>, op2: OperatorFunction<A, B, RESOLVE>, op3: OperatorFunction<B, C, RESOLVE>, op4: OperatorFunction<C, D, RESOLVE>, op5: OperatorFunction<D, E, RESOLVE>, op6: OperatorFunction<E, F, RESOLVE>, op7: OperatorFunction<F, G, RESOLVE>): Subject<G>;
|
|
21
|
+
pipe<A, B, C, D, E, F, G, H, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>, op2: OperatorFunction<A, B, RESOLVE>, op3: OperatorFunction<B, C, RESOLVE>, op4: OperatorFunction<C, D, RESOLVE>, op5: OperatorFunction<D, E, RESOLVE>, op6: OperatorFunction<E, F, RESOLVE>, op7: OperatorFunction<F, G, RESOLVE>, op8: OperatorFunction<G, H, RESOLVE>): Subject<H>;
|
|
22
|
+
pipe<A, B, C, D, E, F, G, H, I, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>, op2: OperatorFunction<A, B, RESOLVE>, op3: OperatorFunction<B, C, RESOLVE>, op4: OperatorFunction<C, D, RESOLVE>, op5: OperatorFunction<D, E, RESOLVE>, op6: OperatorFunction<E, F, RESOLVE>, op7: OperatorFunction<F, G, RESOLVE>, op8: OperatorFunction<G, H, RESOLVE>, op9: OperatorFunction<H, I, RESOLVE>): Subject<I>;
|
|
23
|
+
pipe<A, B, C, D, E, F, G, H, I, RESOLVE>(op1: OperatorFunction<T, A, RESOLVE>, op2: OperatorFunction<A, B, RESOLVE>, op3: OperatorFunction<B, C, RESOLVE>, op4: OperatorFunction<C, D, RESOLVE>, op5: OperatorFunction<D, E, RESOLVE>, op6: OperatorFunction<E, F, RESOLVE>, op7: OperatorFunction<F, G, RESOLVE>, op8: OperatorFunction<G, H, RESOLVE>, op9: OperatorFunction<H, I, RESOLVE>, ...operations: OperatorFunction<any, any, any>[]): Subject<unknown>;
|
|
24
|
+
}
|