Skip to content

Commit

Permalink
fix typescripy error
Browse files Browse the repository at this point in the history
  • Loading branch information
tr3v3r committed Nov 12, 2023
1 parent 538eee5 commit fd0eb4f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/discovery/PrintersDiscovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
const { EscPosPrinterDiscovery } = NativeModules;
const discoveryEventEmmiter = new NativeEventEmitter(EscPosPrinterDiscovery);

export const PrintersDiscovery = new (class PrintersDiscovery {
class PrintersDiscoveryClass {
timeout: ReturnType<typeof setTimeout> | null = null;
status: DiscoveryStatus = 'inactive';
statusListeners: ((status: DiscoveryStatus) => void)[] = [];
Expand Down Expand Up @@ -149,4 +149,10 @@ export const PrintersDiscovery = new (class PrintersDiscovery {
this.status = status;
this.triggerStatusChange(status);
};
})();
}

function initPrintersClass() {
return new PrintersDiscoveryClass();
}

export const PrintersDiscovery = initPrintersClass();

0 comments on commit fd0eb4f

Please sign in to comment.