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
@@ -558,6 +560,57 @@ function onAfterUpdate({ store }) {
558
560
}
559
561
```
560
562
563
+
It's an anti-pattern? Not in Teaful 😊. As only the fragments of the store are updated and not the whole store, it is the same as updating both properties (`cart.items` and `cart.price`) instead of just `cart.items`. The anti-pattern comes when it causes unnecessary rerenders, but this is not the case. Only the components that use `cart.items` and `cart.price` are rerendered and not the others.
564
+
565
+
566
+
## Teaful Devtools 🛠
567
+
568
+
To debug your stores, you can use [Teaful DevTools](https://github.com/teafuljs/teaful-devtools).
To facilitate the creation of libraries that extend Teaful (such as [`teaful-devtools`](https://github.com/teafuljs/teaful-devtools)), we allow the possibility to add an extra that:
576
+
577
+
- Have access to everything returned by each `createStore` consumed: `getStore`, `useStore`, `withStore`.
578
+
- Return an object with new elements to be returned by each `createStore`. It's optional, if nothing is returned it will continue to return the usual. If, for example, you return `{ getCustomThing }` will do an assign with what is currently returned by the `createStore`.
579
+
- Ability to **subscribe**, **unsubscribe** and **notify** in each `createStore`.
0 commit comments