You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/signalstory/README.md
+26-11Lines changed: 26 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -12,21 +12,25 @@
12
12
13
13
signalstory is a state management library based on angular signals. It offers a range of architectural options, from simple repository-based state management (`signal-in-a-service`) to decoupled commands, managed side effect objects, and inter-store communication using an event-based approach. The goal is to provide a great user experience for all developers, whether junior or senior, while incorporating all the features you need to master your frontend state requirements.
14
14
15
-
## Philosophy
15
+
> Starting out? You can keep it nice and simple if you prefer to avoid exploring all the advanced features that a state management library can offer! Begin by checking out the [store](https://zuriscript.github.io/signalstory/docs/store), and only dive into the rest if you're curious later on.
16
+
17
+
## Guiding Principles
16
18
17
19
- 🚀 Use class methods to provide controlled access and mutations to shared state.
18
20
- 🌌 If your store becomes too complex and bloated, slice it into multiple stores.
19
21
- ✨ Join and aggregate your state at the component level using signal mechanics.
20
22
- 🌐 Need to sync states between stores synchronously? - Use events.
21
-
- 🔮 Need to decouple actors and consumers as you do in redux? - Use events.
22
-
- 🔄 Craving Immutability? - Just activate it.
23
+
- 🔮 Need to decouple actors and consumers as you do in `redux`? - Use events.
24
+
- 🔄 Craving `Immutability`? - Just activate it.
23
25
- 🏎️ Don't want full immutability because your store has to be super fast? - Don't activate it.
24
26
- 🧙♂️ Seeking a way to encapsulate side effects in a reusable, maintainable, and testable way? - Use effect objects.
25
27
- 🔍 Want a way to reuse and test queries spanning over multiple stores? - Use query objects.
26
28
- 📦 Don't want to use a class for stores? - You don't have to.
27
29
- 🛠️ Tired of debugging state changes in the console? - Enable redux devtools.
28
-
- ⏳ Need to keep track of store history and selectively perform undo/redo operations? - Enable the history plugin.
30
+
- 🪄 Still want some good old logging magic? - Enable Store logger plugin
31
+
- ⏳ Need to keep track of store history and perform undo/redo operations? - Enable the history plugin.
29
32
- 💾 Want to sync your state with local storage? - Enable the persistence plugin.
33
+
- 📈 Need to get notified of whether your store is modified or currently loading? - Enable the Store Status plugin.
30
34
- 🎨 Something's missing? - Write a custom plugin.
31
35
- 📖 Read the [docs](https://zuriscript.github.io/signalstory/) for more features and concepts.
32
36
@@ -49,12 +53,13 @@ class BookStore extends ImmutableStore<Book[]> {
49
53
super({
50
54
initialState: { ... },
51
55
name: 'Books Store',
52
-
enableLogging: true,
53
56
mutationProducerFn: produce,
54
57
plugins: [
55
58
useDevtools(),
59
+
useLogger(),
56
60
useStoreHistory(),
57
-
useStorePersistence()
61
+
useStorePersistence(),
62
+
useStoreStatus(),
58
63
],
59
64
});
60
65
@@ -82,18 +87,20 @@ class BookStore extends ImmutableStore<Book[]> {
0 commit comments