@scrumble-nl/react-native-honeywell-scanner 1.3.2 → 1.3.3

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/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ declare class Honeywell implements Scanner {
12
12
  barcodeReaderEmitter: any;
13
13
  subscriptionBarcodeReadSuccess: any;
14
14
  subscriptionBarcodeReadFail: any;
15
+ constructor();
15
16
  registerListener: (event: (...args: any[]) => any) => void;
16
17
  clearEventListeners: () => void;
17
18
  onBarcodeReadFail: (event: (...args: any[]) => any) => void;
package/dist/index.js CHANGED
@@ -2,11 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const react_native_1 = require("react-native");
4
4
  const { HoneywellScanner } = react_native_1.NativeModules;
5
+ const eventEmitter = new react_native_1.NativeEventEmitter(HoneywellScanner);
5
6
  class Honeywell {
6
7
  constructor() {
7
- this.barcodeReaderEmitter = new react_native_1.NativeEventEmitter(HoneywellScanner);
8
- this.subscriptionBarcodeReadSuccess = null;
9
- this.subscriptionBarcodeReadFail = null;
10
8
  this.registerListener = (event) => {
11
9
  setTimeout(() => {
12
10
  HoneywellScanner.startScanner().then(() => {
@@ -29,6 +27,9 @@ class Honeywell {
29
27
  this.subscriptionBarcodeReadFail = null;
30
28
  this.subscriptionBarcodeReadFail = this.barcodeReaderEmitter.addListener(HoneywellScanner.BARCODE_READ_FAIL, event);
31
29
  };
30
+ this.barcodeReaderEmitter = eventEmitter;
31
+ this.subscriptionBarcodeReadSuccess = null;
32
+ this.subscriptionBarcodeReadFail = null;
32
33
  }
33
34
  }
34
35
  exports.default = new Honeywell();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scrumble-nl/react-native-honeywell-scanner",
3
3
  "title": "React Native Honeywell Scanner",
4
- "version": "1.3.2",
4
+ "version": "1.3.3",
5
5
  "description": "Bridge to use the Honeywell scanner",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",