diff options
| -rw-r--r-- | package.json | 2 | ||||
| -rw-r--r-- | src/shapex.ts | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/package.json b/package.json index e15e01f..918a687 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shapex", - "version": "1.0.4", + "version": "1.0.5", "description": "A scalable event-driven application framework.", "main": "dist/shapex.cjs", "module": "dist/shapex.js", diff --git a/src/shapex.ts b/src/shapex.ts index 93f40e7..2a42c6b 100644 --- a/src/shapex.ts +++ b/src/shapex.ts @@ -24,7 +24,7 @@ export type Subscription<T> = { export type StateChange = "deleted" | "changed-type" | "changed-value"; -export type ShapeX<T> = { +export type ShapeXInstance<T> = { subscribe: (listener: string, callback: EventCallback<T>) => number; subscribeOnce: (listener: string, callback: EventCallback<T>) => number; unsubscribe: (listener: string) => void; @@ -39,7 +39,7 @@ export type ShapeX<T> = { * @param {T extends object} initialState The initial application state. * @returns {EventX<T>} The EventX object. */ -const ShapeX = <T extends object>(initialState: T): ShapeX<T> => { +const ShapeX = <T extends object>(initialState: T): ShapeXInstance<T> => { let _state = initialState; const _subscriptions: Map<string, Subscription<T>[]> = new Map(); let subscriptionId = 0; |
