diff options
| author | Asko Nõmm <asko@nmm.ee> | 2025-04-14 00:34:41 +0300 |
|---|---|---|
| committer | Asko Nõmm <asko@nmm.ee> | 2025-04-14 00:34:41 +0300 |
| commit | 53c9dad18a612c97cacc3c0fe5eeb01e6ffcc026 (patch) | |
| tree | ddbe9984799b340554ce30b126904f119be121c5 /README.md | |
| parent | 517e45f01af67a22677ae99ca44593f8f0d52057 (diff) | |
Rename EventX to ShapeX
The project is renamed from EventX to ShapeX, updating all references in code,
documentation and package metadata.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -1,19 +1,19 @@ -# EventX +# ShapeX -Create scaleable event-driven applications with EventX, inspired by [re-frame](https://github.com/day8/re-frame/). EventX uses zero dependencies and is runtime agnostic, meaning that you can use it in Node, Deno, Bun, browsers, or really anywhere where JavaScript runs. +Create scalable event-driven applications with ShapeX, inspired by [re-frame](https://github.com/day8/re-frame/). ShapeX uses zero dependencies and is runtime agnostic, meaning that you can use it in Node, Deno, Bun, browsers, or really anywhere where JavaScript runs. ## Example application -This is an example application that demonstrates how to use the EventX library. It has a single starting point event called `request`, which returns an updated state, which changes the `counter`. When that state changes, the subscriber for the `counter` state fires. +This is an example application that demonstrates how to use the ShapeX library. It has a single starting point event called `request`, which returns an updated state, which changes the `counter`. When that state changes, the subscriber for the `counter` state fires. ```typescript -import EventX from "@askonmm/eventx"; +import ShapeX from "ShapeX"; type AppState = { counter: number; }; -const $ = EventX<AppState>({ +const $ = ShapeX<AppState>({ counter: 1, }); @@ -41,23 +41,23 @@ $.dispatch("request"); ## Installation ```shell -npm i @askonmm/eventx +npm i shapex ``` ## Documentation ### State -At the core of your application is state. You start by initiating EventX with some initial state, like so: +At the core of your application is state. You start by initiating ShapeX with some initial state, like so: ```typescript -import EventX from "@askonmm/eventx"; +import ShapeX from "shapex"; type AppState = { counter: number; }; -const $ = EventX<AppState>({ +const $ = ShapeX<AppState>({ counter: 1, }); ``` @@ -109,7 +109,7 @@ $.subscribe("$counter", (state) => { }); ``` -Notable difference here is the `$` prefix in the subscription listener name, which tells EventX what state to look for. Here `$counter` will look for the root-level `counter` key in state. To look for nested state, simply add a dot (`.`) followed by the key name, i.e: `$counter.nestedKey`. Additionally, state change subscriptions do not get any additional data passed to them, only state. +Notable difference here is the `$` prefix in the subscription listener name, which tells ShapeX what state to look for. Here `$counter` will look for the root-level `counter` key in state. To look for nested state, simply add a dot (`.`) followed by the key name, i.e: `$counter.nestedKey`. Additionally, state change subscriptions do not get any additional data passed to them, only state. #### Subscribe only once |
