@brainstack/hub
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -9,5 +9,5 @@ /// <reference path="../../typings/index.d.ts" /> | ||
export interface Options { | ||
source: string; | ||
logger: Logger; | ||
source?: string; | ||
logger?: Logger; | ||
} | ||
export type EventHubFactory = (options: Options) => EventHub; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ import { EventHubFactory } from './abstraction'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createEventHub = void 0; | ||
const log_1 = require("@brainstack/log"); | ||
const utils_1 = require("./utils"); | ||
@@ -10,3 +11,3 @@ /** | ||
*/ | ||
const createEventHub = (options) => { | ||
const createEventHub = (options = { source: "unknown", logger: (0, log_1.createLogger)(3) }) => { | ||
const events = new Map(); | ||
@@ -13,0 +14,0 @@ const regexHandlers = new Map(); |
export { createEventHub } from "./implementation"; | ||
export * from './abstraction'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "@brainstack/hub", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Your package description", | ||
@@ -30,4 +30,5 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@brainstack/log": "^1.0.2", | ||
"ws": "^8.13.0" | ||
} | ||
} |
@@ -13,5 +13,5 @@ | ||
export interface Options { | ||
source: string; | ||
logger: Logger; | ||
source?: string; | ||
logger?: Logger; | ||
} | ||
export type EventHubFactory = (options: Options) => EventHub |
@@ -1,2 +0,3 @@ | ||
import { EventHub, Options, EventHubFactory } from './abstraction'; | ||
import { EventHubFactory } from './abstraction'; | ||
import {createLogger} from '@brainstack/log' | ||
import { uuidv1 } from './utils'; | ||
@@ -9,3 +10,3 @@ | ||
*/ | ||
export const createEventHub: EventHubFactory = (options) => { | ||
export const createEventHub: EventHubFactory = (options={source:"unknown", logger: createLogger(3)}) => { | ||
const events = new Map<string, Map<string, Function>>(); | ||
@@ -12,0 +13,0 @@ const regexHandlers = new Map<RegExp, Map<string, Function>>(); |
15445
2
21
353
+ Added@brainstack/log@^1.0.2
+ Added@brainstack/log@1.1.163(transitive)
+ Addedreflect-metadata@0.2.2(transitive)