From 7af51de7f7760e1b1211d42358760d1310a84591 Mon Sep 17 00:00:00 2001 From: Asko Nõmm Date: Mon, 14 Apr 2025 03:37:07 +0300 Subject: Rename ShapeX interface to ShapeXInstance --- package.json | 2 +- 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 = { export type StateChange = "deleted" | "changed-type" | "changed-value"; -export type ShapeX = { +export type ShapeXInstance = { subscribe: (listener: string, callback: EventCallback) => number; subscribeOnce: (listener: string, callback: EventCallback) => number; unsubscribe: (listener: string) => void; @@ -39,7 +39,7 @@ export type ShapeX = { * @param {T extends object} initialState The initial application state. * @returns {EventX} The EventX object. */ -const ShapeX = (initialState: T): ShapeX => { +const ShapeX = (initialState: T): ShapeXInstance => { let _state = initialState; const _subscriptions: Map[]> = new Map(); let subscriptionId = 0; -- cgit v1.2.3