|
@@ -1,4 +1,3 @@
|
1
|
|
-import * as _ from 'lodash';
|
2
|
1
|
import { ComponentProvider } from 'react-native';
|
3
|
2
|
|
4
|
3
|
export class Store {
|
|
@@ -6,22 +5,22 @@ export class Store {
|
6
|
5
|
private propsById: Record<string, any> = {};
|
7
|
6
|
|
8
|
7
|
setPropsForId(componentId: string, props: any) {
|
9
|
|
- _.set(this.propsById, componentId, props);
|
|
8
|
+ this.propsById[componentId] = props;
|
10
|
9
|
}
|
11
|
10
|
|
12
|
11
|
getPropsForId(componentId: string) {
|
13
|
|
- return _.get(this.propsById, componentId, {});
|
|
12
|
+ return this.propsById[componentId] || {};
|
14
|
13
|
}
|
15
|
14
|
|
16
|
15
|
cleanId(componentId: string) {
|
17
|
|
- _.unset(this.propsById, componentId);
|
|
16
|
+ delete this.propsById[componentId];
|
18
|
17
|
}
|
19
|
18
|
|
20
|
19
|
setComponentClassForName(componentName: string | number, ComponentClass: ComponentProvider) {
|
21
|
|
- _.set(this.componentsByName, componentName.toString(), ComponentClass);
|
|
20
|
+ this.componentsByName[componentName.toString()] = ComponentClass;
|
22
|
21
|
}
|
23
|
22
|
|
24
|
23
|
getComponentClassForName(componentName: string | number): ComponentProvider | undefined {
|
25
|
|
- return _.get(this.componentsByName, componentName.toString());
|
|
24
|
+ return this.componentsByName[componentName.toString()];
|
26
|
25
|
}
|
27
|
26
|
}
|