Quellcode durchsuchen

import export to ModuleJS

Daniel Zlotin vor 7 Jahren
Ursprung
Commit
517ab46fc7

+ 11
- 12
lib/src/Navigation.js Datei anzeigen

@@ -1,14 +1,13 @@
1
-import NativeCommandsSender from './adapters/NativeCommandsSender';
2
-import NativeEventsReceiver from './adapters/NativeEventsReceiver';
3
-import UniqueIdProvider from './adapters/UniqueIdProvider';
4
-
5
-import Store from './containers/Store';
6
-import ContainerRegistry from './containers/ContainerRegistry';
7
-import Commands from './commands/Commands';
8
-import LayoutTreeParser from './commands/LayoutTreeParser';
9
-import LayoutTreeCrawler from './commands/LayoutTreeCrawler';
10
-import PrivateEventsListener from './events/PrivateEventsListener';
11
-import PublicEventsRegistry from './events/PublicEventsRegistry';
1
+const NativeCommandsSender = require('./adapters/NativeCommandsSender');
2
+const NativeEventsReceiver = require('./adapters/NativeEventsReceiver');
3
+const UniqueIdProvider = require('./adapters/UniqueIdProvider');
4
+const Store = require('./containers/Store');
5
+const ContainerRegistry = require('./containers/ContainerRegistry');
6
+const Commands = require('./commands/Commands');
7
+const LayoutTreeParser = require('./commands/LayoutTreeParser');
8
+const LayoutTreeCrawler = require('./commands/LayoutTreeCrawler');
9
+const PrivateEventsListener = require('./events/PrivateEventsListener');
10
+const PublicEventsRegistry = require('./events/PublicEventsRegistry');
12 11
 
13 12
 class Navigation {
14 13
   constructor() {
@@ -71,4 +70,4 @@ class Navigation {
71 70
 }
72 71
 
73 72
 const singleton = new Navigation();
74
-export default singleton;
73
+module.exports = singleton;

+ 3
- 2
lib/src/adapters/NativeCommandsSender.js Datei anzeigen

@@ -1,6 +1,6 @@
1
-import { NativeModules } from 'react-native';
1
+const { NativeModules } = require('react-native');
2 2
 
3
-export default class NativeCommandsSender {
3
+class NativeCommandsSender {
4 4
   constructor() {
5 5
     this.nativeCommandsModule = NativeModules.RNNBridgeModule;
6 6
   }
@@ -50,3 +50,4 @@ export default class NativeCommandsSender {
50 50
   }
51 51
 }
52 52
 
53
+module.exports = NativeCommandsSender;

+ 1
- 1
lib/src/adapters/NativeCommandsSender.mock.js Datei anzeigen

@@ -1 +1 @@
1
-export default jest.genMockFromModule('./NativeCommandsSender').default;
1
+module.exports = jest.genMockFromModule('./NativeCommandsSender');

+ 4
- 2
lib/src/adapters/NativeEventsReceiver.js Datei anzeigen

@@ -1,6 +1,6 @@
1
-import { NativeModules, NativeEventEmitter } from 'react-native';
1
+const { NativeModules, NativeEventEmitter } = require('react-native');
2 2
 
3
-export default class NativeEventsReceiver {
3
+class NativeEventsReceiver {
4 4
   constructor() {
5 5
     this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
6 6
   }
@@ -17,3 +17,5 @@ export default class NativeEventsReceiver {
17 17
     this.emitter.addListener('RNN.appLaunched', callback);
18 18
   }
19 19
 }
20
+
21
+module.exports = NativeEventsReceiver;

+ 1
- 1
lib/src/adapters/NativeEventsReceiver.mock.js Datei anzeigen

@@ -1 +1 @@
1
-export default jest.genMockFromModule('./NativeEventsReceiver').default;
1
+module.exports = jest.genMockFromModule('./NativeEventsReceiver');

+ 4
- 2
lib/src/adapters/UniqueIdProvider.js Datei anzeigen

@@ -1,7 +1,9 @@
1
-import _ from 'lodash';
1
+const _ = require('lodash');
2 2
 
3
-export default class UniqueIdProvider {
3
+class UniqueIdProvider {
4 4
   generate(prefix) {
5 5
     return _.uniqueId(prefix);
6 6
   }
7 7
 }
8
+
9
+module.exports = UniqueIdProvider;

+ 2
- 1
lib/src/adapters/UniqueIdProvider.mock.js Datei anzeigen

@@ -1,6 +1,7 @@
1
-export default class UniqueIdProvider {
1
+class UniqueIdProvider {
2 2
   generate(prefix) {
3 3
     return `${prefix}+UNIQUE_ID`;
4 4
   }
5 5
 }
6 6
 
7
+module.exports = UniqueIdProvider;

+ 5
- 4
lib/src/commands/Commands.js Datei anzeigen

@@ -1,7 +1,7 @@
1
-import _ from 'lodash';
2
-import optionsProcessor from './OptionsProcessor';
1
+const _ = require('lodash');
2
+const OptionsProcessor = require('./OptionsProcessor');
3 3
 
4
-export default class Commands {
4
+class Commands {
5 5
   constructor(nativeCommandsSender, layoutTreeParser, layoutTreeCrawler) {
6 6
     this.nativeCommandsSender = nativeCommandsSender;
7 7
     this.layoutTreeParser = layoutTreeParser;
@@ -17,7 +17,7 @@ export default class Commands {
17 17
 
18 18
   setOptions(containerId, options) {
19 19
     const input = _.cloneDeep(options);
20
-    optionsProcessor(input);
20
+    OptionsProcessor.processOptions(input);
21 21
     this.nativeCommandsSender.setOptions(containerId, input);
22 22
   }
23 23
 
@@ -56,3 +56,4 @@ export default class Commands {
56 56
   }
57 57
 }
58 58
 
59
+module.exports = Commands;

+ 7
- 8
lib/src/commands/Commands.test.js Datei anzeigen

@@ -1,11 +1,10 @@
1
-import * as SimpleLayouts from './SimpleLayouts';
2
-import LayoutTreeParser from './LayoutTreeParser';
3
-import LayoutTreeCrawler from './LayoutTreeCrawler';
4
-import Store from '../containers/Store';
5
-import UniqueIdProvider from '../adapters/UniqueIdProvider.mock';
6
-import NativeCommandsSender from '../adapters/NativeCommandsSender.mock';
7
-
8
-import Commands from './Commands';
1
+const SimpleLayouts = require('./SimpleLayouts');
2
+const LayoutTreeParser = require('./LayoutTreeParser');
3
+const LayoutTreeCrawler = require('./LayoutTreeCrawler');
4
+const Store = require('../containers/Store');
5
+const UniqueIdProvider = require('../adapters/UniqueIdProvider.mock');
6
+const NativeCommandsSender = require('../adapters/NativeCommandsSender.mock');
7
+const Commands = require('./Commands');
9 8
 
10 9
 describe('Commands', () => {
11 10
   let uut;

+ 7
- 5
lib/src/commands/LayoutTreeCrawler.js Datei anzeigen

@@ -1,8 +1,8 @@
1
-import _ from 'lodash';
2
-import LayoutTypes from './LayoutTypes';
3
-import optionsProcessor from './OptionsProcessor';
1
+const _ = require('lodash');
2
+const LayoutTypes = require('./LayoutTypes');
3
+const OptionsProcessor = require('./OptionsProcessor');
4 4
 
5
-export default class LayoutTreeCrawler {
5
+class LayoutTreeCrawler {
6 6
   constructor(uniqueIdProvider, store) {
7 7
     this.uniqueIdProvider = uniqueIdProvider;
8 8
     this.store = store;
@@ -25,7 +25,7 @@ export default class LayoutTreeCrawler {
25 25
     this.store.setPropsForContainerId(node.id, node.data.passProps);
26 26
     const clazz = this.store.getOriginalContainerClassForName(node.data.name);
27 27
     node.data.navigationOptions = _.cloneDeep(_.get(clazz, 'navigationOptions', {}));
28
-    optionsProcessor(node.data.navigationOptions);
28
+    OptionsProcessor.processOptions(node.data.navigationOptions);
29 29
   }
30 30
 
31 31
   _assertKnownLayoutType(type) {
@@ -40,3 +40,5 @@ export default class LayoutTreeCrawler {
40 40
     }
41 41
   }
42 42
 }
43
+
44
+module.exports = LayoutTreeCrawler;

+ 4
- 4
lib/src/commands/LayoutTreeCrawler.test.js Datei anzeigen

@@ -1,7 +1,7 @@
1
-import LayoutTypes from './LayoutTypes';
2
-import LayoutTreeCrawler from './LayoutTreeCrawler';
3
-import Store from '../containers/Store';
4
-import UniqueIdProvider from '../adapters/UniqueIdProvider.mock';
1
+const LayoutTypes = require('./LayoutTypes');
2
+const LayoutTreeCrawler = require('./LayoutTreeCrawler');
3
+const Store = require('../containers/Store');
4
+const UniqueIdProvider = require('../adapters/UniqueIdProvider.mock');
5 5
 
6 6
 describe('LayoutTreeCrawler', () => {
7 7
   let uut;

+ 5
- 3
lib/src/commands/LayoutTreeParser.js Datei anzeigen

@@ -1,7 +1,7 @@
1
-import * as _ from 'lodash';
2
-import LayoutTypes from './LayoutTypes';
1
+const _ = require('lodash');
2
+const LayoutTypes = require('./LayoutTypes');
3 3
 
4
-export default class LayoutTreeParser {
4
+class LayoutTreeParser {
5 5
   /**
6 6
    * returns correct layout tree of {type, children, data?}
7 7
    */
@@ -67,3 +67,5 @@ export default class LayoutTreeParser {
67 67
     return children;
68 68
   }
69 69
 }
70
+
71
+module.exports = LayoutTreeParser;

+ 2
- 2
lib/src/commands/LayoutTreeParser.test.js Datei anzeigen

@@ -1,5 +1,5 @@
1
-import * as SimpleLayouts from './SimpleLayouts';
2
-import LayoutTreeParser from './LayoutTreeParser';
1
+const SimpleLayouts = require('./SimpleLayouts');
2
+const LayoutTreeParser = require('./LayoutTreeParser');
3 3
 
4 4
 describe('LayoutTreeParser', () => {
5 5
   let uut;

+ 1
- 1
lib/src/commands/LayoutTypes.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-export default {
1
+module.exports = {
2 2
   Container: 'Container',
3 3
   ContainerStack: 'ContainerStack',
4 4
   BottomTabs: 'BottomTabs',

+ 15
- 11
lib/src/commands/OptionsProcessor.js Datei anzeigen

@@ -1,13 +1,17 @@
1
-import _ from 'lodash';
2
-import { processColor } from 'react-native';
1
+const _ = require('lodash');
2
+const { processColor } = require('react-native');
3 3
 
4
-export default function optionsProcessor(navigationOptions) {
5
-  _.forEach(navigationOptions, (value, key) => {
6
-    if (_.endsWith(key, 'Color')) {
7
-      navigationOptions[key] = processColor(value);
8
-    }
9
-    if (_.isPlainObject(value)) {
10
-      optionsProcessor(value);
11
-    }
12
-  });
4
+class OptionsProcessor {
5
+  static processOptions(navigationOptions) {
6
+    _.forEach(navigationOptions, (value, key) => {
7
+      if (_.endsWith(key, 'Color')) {
8
+        navigationOptions[key] = processColor(value);
9
+      }
10
+      if (_.isPlainObject(value)) {
11
+        OptionsProcessor.processOptions(value);
12
+      }
13
+    });
14
+  }
13 15
 }
16
+
17
+module.exports = OptionsProcessor;

+ 12
- 12
lib/src/commands/OptionsProcessor.test.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-import optionsProcessor from './OptionsProcessor';
1
+const OptionsProcessor = require('./OptionsProcessor');
2 2
 
3 3
 describe('navigation options', () => {
4 4
   let navigationOptions;
@@ -9,46 +9,46 @@ describe('navigation options', () => {
9 9
 
10 10
   it('processes colors into numeric AARRGGBB', () => {
11 11
     navigationOptions.someKeyColor = 'red';
12
-    optionsProcessor(navigationOptions);
12
+    OptionsProcessor.processOptions(navigationOptions);
13 13
     expect(navigationOptions.someKeyColor).toEqual(0xffff0000);
14 14
 
15 15
     navigationOptions.someKeyColor = 'yellow';
16
-    optionsProcessor(navigationOptions);
16
+    OptionsProcessor.processOptions(navigationOptions);
17 17
     expect(navigationOptions.someKeyColor).toEqual(0xffffff00);
18 18
   });
19 19
 
20 20
   it('processes numeric colors', () => {
21 21
     navigationOptions.someKeyColor = '#123456';
22
-    optionsProcessor(navigationOptions);
22
+    OptionsProcessor.processOptions(navigationOptions);
23 23
     expect(navigationOptions.someKeyColor).toEqual(0xff123456);
24 24
 
25 25
     navigationOptions.someKeyColor = 0x123456ff; // wut
26
-    optionsProcessor(navigationOptions);
26
+    OptionsProcessor.processOptions(navigationOptions);
27 27
     expect(navigationOptions.someKeyColor).toEqual(0xff123456);
28 28
   });
29 29
 
30 30
   it('process colors with rgb functions', () => {
31 31
     navigationOptions.someKeyColor = 'rgb(255, 0, 255)';
32
-    optionsProcessor(navigationOptions);
32
+    OptionsProcessor.processOptions(navigationOptions);
33 33
     expect(navigationOptions.someKeyColor).toEqual(0xffff00ff);
34 34
   });
35 35
 
36 36
   it('process colors with special words', () => {
37 37
     navigationOptions.someKeyColor = 'fuchsia';
38
-    optionsProcessor(navigationOptions);
38
+    OptionsProcessor.processOptions(navigationOptions);
39 39
     expect(navigationOptions.someKeyColor).toEqual(0xffff00ff);
40 40
   });
41 41
 
42 42
   it('process colors with hsla functions', () => {
43 43
     navigationOptions.someKeyColor = 'hsla(360, 100%, 100%, 1.0)';
44
-    optionsProcessor(navigationOptions);
44
+    OptionsProcessor.processOptions(navigationOptions);
45 45
 
46 46
     expect(navigationOptions.someKeyColor).toEqual(0xffffffff);
47 47
   });
48 48
 
49 49
   it('unknown colors return undefined', () => {
50 50
     navigationOptions.someKeyColor = 'wut';
51
-    optionsProcessor(navigationOptions);
51
+    OptionsProcessor.processOptions(navigationOptions);
52 52
     expect(navigationOptions.someKeyColor).toEqual(undefined);
53 53
   });
54 54
 
@@ -56,7 +56,7 @@ describe('navigation options', () => {
56 56
     navigationOptions.otherKeyColor = 'red';
57 57
     navigationOptions.yetAnotherColor = 'blue';
58 58
     navigationOptions.andAnotherColor = 'rgb(0, 255, 0)';
59
-    optionsProcessor(navigationOptions);
59
+    OptionsProcessor.processOptions(navigationOptions);
60 60
     expect(navigationOptions.otherKeyColor).toEqual(0xffff0000);
61 61
     expect(navigationOptions.yetAnotherColor).toEqual(0xff0000ff);
62 62
     expect(navigationOptions.andAnotherColor).toEqual(0xff00ff00);
@@ -64,14 +64,14 @@ describe('navigation options', () => {
64 64
 
65 65
   it('keys ending with Color case sensitive', () => {
66 66
     navigationOptions.otherKey_color = 'red'; // eslint-disable-line camelcase
67
-    optionsProcessor(navigationOptions);
67
+    OptionsProcessor.processOptions(navigationOptions);
68 68
     expect(navigationOptions.otherKey_color).toEqual('red');
69 69
   });
70 70
 
71 71
   it('any nested recursive keys ending with Color', () => {
72 72
     navigationOptions.innerObj = { theKeyColor: 'red' };
73 73
     navigationOptions.innerObj.innerMostObj = { anotherColor: 'yellow' };
74
-    optionsProcessor(navigationOptions);
74
+    OptionsProcessor.processOptions(navigationOptions);
75 75
     expect(navigationOptions.innerObj.theKeyColor).toEqual(0xffff0000);
76 76
     expect(navigationOptions.innerObj.innerMostObj.anotherColor).toEqual(0xffffff00);
77 77
   });

+ 19
- 8
lib/src/commands/SimpleLayouts.js Datei anzeigen

@@ -1,17 +1,17 @@
1
-export const singleScreenApp = {
1
+const singleScreenApp = {
2 2
   container: {
3 3
     name: 'com.example.MyScreen'
4 4
   }
5 5
 };
6 6
 
7
-export const passProps = {
7
+const passProps = {
8 8
   strProp: 'string prop',
9 9
   numProp: 12345,
10 10
   objProp: { inner: { foo: 'bar' } },
11 11
   fnProp: () => 'Hello from a function'
12 12
 };
13 13
 
14
-export const singleScreenWithAditionalParams = {
14
+const singleScreenWithAditionalParams = {
15 15
   container: {
16 16
     name: 'com.example.MyScreen',
17 17
     passProps,
@@ -20,7 +20,7 @@ export const singleScreenWithAditionalParams = {
20 20
   }
21 21
 };
22 22
 
23
-export const tabBasedApp = {
23
+const tabBasedApp = {
24 24
   bottomTabs: [
25 25
     {
26 26
       container: {
@@ -40,7 +40,7 @@ export const tabBasedApp = {
40 40
   ]
41 41
 };
42 42
 
43
-export const singleWithSideMenu = {
43
+const singleWithSideMenu = {
44 44
   container: {
45 45
     name: 'com.example.MyScreen'
46 46
   },
@@ -53,7 +53,7 @@ export const singleWithSideMenu = {
53 53
   }
54 54
 };
55 55
 
56
-export const singleWithRightSideMenu = {
56
+const singleWithRightSideMenu = {
57 57
   container: {
58 58
     name: 'com.example.MyScreen'
59 59
   },
@@ -66,7 +66,7 @@ export const singleWithRightSideMenu = {
66 66
   }
67 67
 };
68 68
 
69
-export const singleWithBothMenus = {
69
+const singleWithBothMenus = {
70 70
   container: {
71 71
     name: 'com.example.MyScreen'
72 72
   },
@@ -84,7 +84,7 @@ export const singleWithBothMenus = {
84 84
   }
85 85
 };
86 86
 
87
-export const tabBasedWithBothSideMenus = {
87
+const tabBasedWithBothSideMenus = {
88 88
   bottomTabs: [
89 89
     {
90 90
       container: {
@@ -110,3 +110,14 @@ export const tabBasedWithBothSideMenus = {
110 110
     }
111 111
   }
112 112
 };
113
+
114
+module.exports = {
115
+  singleScreenApp,
116
+  passProps,
117
+  singleScreenWithAditionalParams,
118
+  tabBasedApp,
119
+  singleWithSideMenu,
120
+  singleWithRightSideMenu,
121
+  singleWithBothMenus,
122
+  tabBasedWithBothSideMenus
123
+};

+ 5
- 3
lib/src/containers/ContainerRegistry.js Datei anzeigen

@@ -1,7 +1,7 @@
1
-import { AppRegistry } from 'react-native';
2
-import ContainerWrapper from './ContainerWrapper';
1
+const { AppRegistry } = require('react-native');
2
+const ContainerWrapper = require('./ContainerWrapper');
3 3
 
4
-export default class ContainerRegistry {
4
+class ContainerRegistry {
5 5
   constructor(store) {
6 6
     this.store = store;
7 7
   }
@@ -13,3 +13,5 @@ export default class ContainerRegistry {
13 13
     AppRegistry.registerComponent(containerName, () => NavigationContainer);
14 14
   }
15 15
 }
16
+
17
+module.exports = ContainerRegistry;

+ 6
- 5
lib/src/containers/ContainerRegistry.test.js Datei anzeigen

@@ -1,9 +1,10 @@
1
-import React, { Component } from 'react';
2
-import { AppRegistry, Text } from 'react-native';
3
-import renderer from 'react-test-renderer';
1
+const React = require('react');
2
+const { Component } = require('react');
3
+const { AppRegistry, Text } = require('react-native');
4 4
 
5
-import ContainerRegistry from './ContainerRegistry';
6
-import Store from './Store';
5
+const renderer = require('react-test-renderer');
6
+const ContainerRegistry = require('./ContainerRegistry');
7
+const Store = require('./Store');
7 8
 
8 9
 describe('ContainerRegistry', () => {
9 10
   let uut;

+ 7
- 3
lib/src/containers/ContainerWrapper.js Datei anzeigen

@@ -1,7 +1,9 @@
1
-import _ from 'lodash';
2
-import React, { Component } from 'react';
1
+const _ = require('lodash');
3 2
 
4
-export default class ContainerWrapper {
3
+const React = require('react');
4
+const { Component } = require('react');
5
+
6
+class ContainerWrapper {
5 7
   static wrap(containerName, OriginalContainer, store) {
6 8
     return class extends Component {
7 9
       constructor(props) {
@@ -67,3 +69,5 @@ export default class ContainerWrapper {
67 69
     };
68 70
   }
69 71
 }
72
+
73
+module.exports = ContainerWrapper;

+ 6
- 6
lib/src/containers/ContainerWrapper.test.js Datei anzeigen

@@ -1,10 +1,10 @@
1
-/* eslint-disable consistent-this, react/no-multi-comp */
2
-import React, { Component } from 'react';
3
-import { Text } from 'react-native';
4
-import renderer from 'react-test-renderer';
1
+const React = require('react');
2
+const { Component } = require('react');
5 3
 
6
-import ContainerWrapper from './ContainerWrapper';
7
-import Store from './Store';
4
+const { Text } = require('react-native');
5
+const renderer = require('react-test-renderer');
6
+const ContainerWrapper = require('./ContainerWrapper');
7
+const Store = require('./Store');
8 8
 
9 9
 describe('ContainerWrapper', () => {
10 10
   let store;

+ 3
- 1
lib/src/containers/Lifecycle.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-export default class Lifecycle {
1
+class Lifecycle {
2 2
   constructor(store) {
3 3
     this.store = store;
4 4
     this.containerStart = this.containerStart.bind(this);
@@ -19,3 +19,5 @@ export default class Lifecycle {
19 19
     }
20 20
   }
21 21
 }
22
+
23
+module.exports = Lifecycle;

+ 2
- 2
lib/src/containers/Lifecycle.test.js Datei anzeigen

@@ -1,5 +1,5 @@
1
-import Lifecycle from './Lifecycle';
2
-import Store from '../containers/Store';
1
+const Lifecycle = require('./Lifecycle');
2
+const Store = require('../containers/Store');
3 3
 
4 4
 describe('Lifecycle', () => {
5 5
   let store;

+ 4
- 2
lib/src/containers/Store.js Datei anzeigen

@@ -1,6 +1,6 @@
1
-import _ from 'lodash';
1
+const _ = require('lodash');
2 2
 
3
-export default class Store {
3
+class Store {
4 4
   constructor() {
5 5
     this.propsByContainerId = {};
6 6
     this.containersByName = {};
@@ -36,3 +36,5 @@ export default class Store {
36 36
     _.unset(this.propsByContainerId, id);
37 37
   }
38 38
 }
39
+
40
+module.exports = Store;

+ 1
- 1
lib/src/containers/Store.test.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-import Store from './Store';
1
+const Store = require('./Store');
2 2
 
3 3
 describe('Store', () => {
4 4
   let uut;

+ 4
- 2
lib/src/events/PrivateEventsListener.js Datei anzeigen

@@ -1,6 +1,6 @@
1
-import Lifecycle from '../containers/Lifecycle';
1
+const Lifecycle = require('../containers/Lifecycle');
2 2
 
3
-export default class PrivateEventsListener {
3
+class PrivateEventsListener {
4 4
   constructor(nativeEventsReceiver, store) {
5 5
     this.nativeEventsReceiver = nativeEventsReceiver;
6 6
     this.lifecycle = new Lifecycle(store);
@@ -11,3 +11,5 @@ export default class PrivateEventsListener {
11 11
     this.nativeEventsReceiver.containerStop(this.lifecycle.containerStop);
12 12
   }
13 13
 }
14
+
15
+module.exports = PrivateEventsListener;

+ 3
- 3
lib/src/events/PrivateEventsListener.test.js Datei anzeigen

@@ -1,6 +1,6 @@
1
-import PrivateEventsListener from './PrivateEventsListener';
2
-import NativeEventsReceiver from '../adapters/NativeEventsReceiver.mock';
3
-import Store from '../containers/Store';
1
+const PrivateEventsListener = require('./PrivateEventsListener');
2
+const NativeEventsReceiver = require('../adapters/NativeEventsReceiver.mock');
3
+const Store = require('../containers/Store');
4 4
 
5 5
 describe('PrivateEventsListener', () => {
6 6
   let uut;

+ 3
- 1
lib/src/events/PublicEventsRegistry.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-export default class PublicEventsRegistry {
1
+class PublicEventsRegistry {
2 2
   constructor(nativeEventsReceiver) {
3 3
     this.nativeEventsReceiver = nativeEventsReceiver;
4 4
   }
@@ -7,3 +7,5 @@ export default class PublicEventsRegistry {
7 7
     this.nativeEventsReceiver.appLaunched(callback);
8 8
   }
9 9
 }
10
+
11
+module.exports = PublicEventsRegistry;

+ 2
- 2
lib/src/events/PublicEventsRegistry.test.js Datei anzeigen

@@ -1,5 +1,5 @@
1
-import PublicEventsRegistry from './PublicEventsRegistry';
2
-import NativeEventsReceiver from '../adapters/NativeEventsReceiver.mock';
1
+const PublicEventsRegistry = require('./PublicEventsRegistry');
2
+const NativeEventsReceiver = require('../adapters/NativeEventsReceiver.mock');
3 3
 
4 4
 describe('PublicEventsRegistry', () => {
5 5
   let uut;

+ 1
- 1
lib/src/index.js Datei anzeigen

@@ -1,4 +1,4 @@
1
-import Navigation from './Navigation';
1
+const Navigation = require('./Navigation');
2 2
 
3 3
 module.exports = Navigation;
4 4
 module.exports.default = Navigation;