summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsko Nõmm <asko@nmm.ee>2025-04-14 03:37:07 +0300
committerAsko Nõmm <asko@nmm.ee>2025-04-14 03:37:07 +0300
commit7af51de7f7760e1b1211d42358760d1310a84591 (patch)
tree463ba833a1beb3956230332508c820b0d8bf8de7
parent67c923606facdb3222d181981c748d7647ac446c (diff)
Rename ShapeX interface to ShapeXInstance
-rw-r--r--package.json2
-rw-r--r--src/shapex.ts4
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;