@nymphjs/client 1.0.0-beta.7 → 1.0.0-beta.71
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/CHANGELOG.md +304 -0
- package/README.md +4 -4
- package/asyncitertest.js +53 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/lib/Entity.d.ts +112 -8
- package/lib/Entity.js +158 -76
- package/lib/Entity.js.map +1 -1
- package/lib/Entity.types.d.ts +144 -9
- package/lib/EntityWeakCache.js +3 -2
- package/lib/EntityWeakCache.js.map +1 -1
- package/lib/HttpRequester.d.ts +44 -8
- package/lib/HttpRequester.js +236 -21
- package/lib/HttpRequester.js.map +1 -1
- package/lib/Nymph.d.ts +43 -11
- package/lib/Nymph.js +102 -19
- package/lib/Nymph.js.map +1 -1
- package/lib/Nymph.types.d.ts +48 -1
- package/lib/PubSub.d.ts +15 -9
- package/lib/PubSub.js +148 -87
- package/lib/PubSub.js.map +1 -1
- package/lib/PubSub.types.d.ts +6 -1
- package/lib/entityRefresh.js +16 -0
- package/lib/entityRefresh.js.map +1 -1
- package/lib/utils.js +11 -0
- package/lib/utils.js.map +1 -1
- package/package.json +17 -14
- package/src/Entity.ts +163 -103
- package/src/Entity.types.ts +10 -46
- package/src/EntityWeakCache.ts +7 -5
- package/src/HttpRequester.ts +302 -29
- package/src/Nymph.ts +140 -67
- package/src/Nymph.types.ts +15 -1
- package/src/PubSub.ts +205 -132
- package/src/PubSub.types.ts +8 -3
- package/src/entityRefresh.ts +5 -5
- package/tsconfig.json +1 -1
- package/typedoc.json +4 -0
package/src/entityRefresh.ts
CHANGED
|
@@ -14,7 +14,7 @@ export function saveEntities(entity: Entity) {
|
|
|
14
14
|
|
|
15
15
|
const addEntitiesToObject = (
|
|
16
16
|
item: any,
|
|
17
|
-
entitiesObject: { [k: string]: Entity }
|
|
17
|
+
entitiesObject: { [k: string]: Entity },
|
|
18
18
|
) => {
|
|
19
19
|
// @ts-ignore: Accessing a private property.
|
|
20
20
|
if (item instanceof Entity && !item.$isASleepingReference) {
|
|
@@ -37,7 +37,7 @@ const addEntitiesToObject = (
|
|
|
37
37
|
// after the restore.
|
|
38
38
|
export function restoreEntities(
|
|
39
39
|
entity: Entity,
|
|
40
|
-
savedEntities: { [k: string]: Entity }
|
|
40
|
+
savedEntities: { [k: string]: Entity },
|
|
41
41
|
) {
|
|
42
42
|
let data: { containsSleepingReference: boolean } = {
|
|
43
43
|
containsSleepingReference: false,
|
|
@@ -49,7 +49,7 @@ export function restoreEntities(
|
|
|
49
49
|
entity.$dataStore[key] = retoreEntitiesFromObject(
|
|
50
50
|
value,
|
|
51
51
|
savedEntities,
|
|
52
|
-
data
|
|
52
|
+
data,
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -59,7 +59,7 @@ export function restoreEntities(
|
|
|
59
59
|
const retoreEntitiesFromObject = <T extends any>(
|
|
60
60
|
item: T,
|
|
61
61
|
entitiesObject: { [k: string]: Entity },
|
|
62
|
-
data: { containsSleepingReference: boolean }
|
|
62
|
+
data: { containsSleepingReference: boolean },
|
|
63
63
|
): T => {
|
|
64
64
|
if (item instanceof Entity) {
|
|
65
65
|
// @ts-ignore: Accessing a private property.
|
|
@@ -78,7 +78,7 @@ const retoreEntitiesFromObject = <T extends any>(
|
|
|
78
78
|
} else if (Array.isArray(item)) {
|
|
79
79
|
// Recurse into lower arrays.
|
|
80
80
|
return item.map((item) =>
|
|
81
|
-
retoreEntitiesFromObject(item, entitiesObject, data)
|
|
81
|
+
retoreEntitiesFromObject(item, entitiesObject, data),
|
|
82
82
|
) as T;
|
|
83
83
|
} else if (item instanceof Object) {
|
|
84
84
|
for (let [key, value] of Object.entries(item)) {
|
package/tsconfig.json
CHANGED
package/typedoc.json
ADDED