Skip to content

Commit 4703b28

Browse files
committed
finish masterState
1 parent 106750e commit 4703b28

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/backend/masterState.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ import 'core-js';
33
/* eslint-disable no-plusplus */
44
/* eslint-disable guard-for-in */
55
/* eslint-disable no-restricted-syntax */
6-
const componentActionsRecord : Array<any> = [];
6+
7+
// import {Hook}
8+
import {
9+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
10+
HookStateItem,
11+
HookStates
12+
} from './types/backendTypes';
13+
14+
const componentActionsRecord: HookStates = [];
715
let index : number = 0;
816

917
export default {
@@ -12,8 +20,8 @@ export default {
1220
index++;
1321
return index - 1;
1422
},
15-
getRecordByIndex: (inputIndex : number) : any => componentActionsRecord[inputIndex],
16-
getComponentByIndex: (inputIndex: number) : any => (componentActionsRecord[inputIndex]
23+
getRecordByIndex: (inputIndex: number): HookStateItem => componentActionsRecord[inputIndex],
24+
getComponentByIndex: (inputIndex: number): any => (componentActionsRecord[inputIndex]
1725
? componentActionsRecord[inputIndex].component
1826
: undefined),
1927
};

src/backend/timeJump.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default (origin, mode) => {
4949
}, () => target.children.forEach(child => jump(child)));
5050
}
5151

52-
console.log('TARGET', target);
52+
// console.log('TARGET', target);
5353
// Check for hooks state and set it with dispatch()
5454
if (target.state && target.state.hooksState) {
5555
target.state.hooksState.forEach(hook => {

src/backend/types/backendTypes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/* eslint-disable @typescript-eslint/no-explicit-any */
44
import Tree from '../tree';
55

6+
67
export interface Snapshot {
78
tree: Tree;
89
unfilteredTree: null;
@@ -38,7 +39,7 @@ export interface ComponentData {
3839
treeBaseDuration?: number;
3940
}
4041

41-
interface HookStateItem {
42+
export interface HookStateItem {
4243
state: any;
4344
component: any;
4445
}

0 commit comments

Comments
 (0)