@flighthq/flow 0.5.1-next.903.f434bc2 → 0.5.1-next.905.5fbf787
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/README.md +2 -2
- package/package.json +3 -3
- package/src/flow.test.ts +18 -12
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/flow`. The `@flighth
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/flow@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/flow@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/flow)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/flow",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.905.5fbf787",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/entity": "0.5.1-next.
|
|
42
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/entity": "0.5.1-next.905.5fbf787",
|
|
42
|
+
"@flighthq/types": "0.5.1-next.905.5fbf787"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^5.3.0"
|
package/src/flow.test.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
getActiveFlowState,
|
|
7
7
|
getFlowStackDepth,
|
|
8
8
|
getFlowStackVisibleStates,
|
|
9
|
+
initializeFlowStack,
|
|
9
10
|
popFlowState,
|
|
10
11
|
pushFlowState,
|
|
11
12
|
replaceFlowState,
|
|
@@ -129,6 +130,12 @@ describe('getFlowStackVisibleStates', () => {
|
|
|
129
130
|
});
|
|
130
131
|
});
|
|
131
132
|
|
|
133
|
+
describe('initializeFlowStack', () => {
|
|
134
|
+
it('is the construction initializer of createFlowStack', () => {
|
|
135
|
+
expect(typeof initializeFlowStack).toBe('function');
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
132
139
|
describe('popFlowState', () => {
|
|
133
140
|
it('exits the top and resumes the revealed state, returning the popped state', () => {
|
|
134
141
|
const log: string[] = [];
|
|
@@ -220,6 +227,17 @@ describe('replaceFlowState', () => {
|
|
|
220
227
|
});
|
|
221
228
|
});
|
|
222
229
|
|
|
230
|
+
function labeledState(name: string, log: string[], extra: Partial<FlowState> = {}): FlowState {
|
|
231
|
+
return {
|
|
232
|
+
name,
|
|
233
|
+
onEnter: () => log.push(`${name}.enter`),
|
|
234
|
+
onExit: () => log.push(`${name}.exit`),
|
|
235
|
+
onPause: () => log.push(`${name}.pause`),
|
|
236
|
+
onResume: () => log.push(`${name}.resume`),
|
|
237
|
+
onUpdate: (deltaTime) => log.push(`${name}.update:${deltaTime}`),
|
|
238
|
+
...extra,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
223
241
|
describe('updateFlowStack', () => {
|
|
224
242
|
it('ticks only the top with the frame deltaTime', () => {
|
|
225
243
|
const log: string[] = [];
|
|
@@ -274,15 +292,3 @@ describe('updateFlowStack', () => {
|
|
|
274
292
|
expect(() => updateFlowStack(stack, 0.016)).not.toThrow();
|
|
275
293
|
});
|
|
276
294
|
});
|
|
277
|
-
|
|
278
|
-
function labeledState(name: string, log: string[], extra: Partial<FlowState> = {}): FlowState {
|
|
279
|
-
return {
|
|
280
|
-
name,
|
|
281
|
-
onEnter: () => log.push(`${name}.enter`),
|
|
282
|
-
onExit: () => log.push(`${name}.exit`),
|
|
283
|
-
onPause: () => log.push(`${name}.pause`),
|
|
284
|
-
onResume: () => log.push(`${name}.resume`),
|
|
285
|
-
onUpdate: (deltaTime) => log.push(`${name}.update:${deltaTime}`),
|
|
286
|
-
...extra,
|
|
287
|
-
};
|
|
288
|
-
}
|