Replies: 3 comments 2 replies
-
The saved state inside the store can be every type: array, object, set, map, boolean, string, number... So support methods to manage the state depending the type is going to be negative for the goal of the library. It's better to be a simple way, the same way for all types. The goals of Teaful is to be tiny, easy and powerful. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Maybe you can do this: function push(proxy, element) {
const [, set] = proxy(getStore)
set(a => [...a, element])
}
// Add new cart item
push(proxy => proxy.cart.items(), newItem) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For setStore function
If proxy of type array then introduce function like push, filter, update, remove, clear
Can use like
Beta Was this translation helpful? Give feedback.
All reactions