simplify mental model of store creation #165
DmitryEfimenko
started this conversation in
Ideas
Replies: 2 comments 3 replies
-
It was meant to be able to create an entire shared state. Anyway, you're welcome to add this function to the library. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Do you mind telling me more? What's the use case? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I don't quite understand why by default elf requires a developer to create a
state
and astore
in two separate steps.When I saw the documentation for the first time, I found it quite confusing that the
createState
function returns astate
andconfig
objects that then need to be passed into theStore
constructor.If I'm not mistaken, the
state
andconfig
variables are not expected to be used for anything else except for instantiating thestore
.It's possible I'm missing something. In that case, please elaborate.
I think elf would be much easier to understand if instead we had a single function to call:
createStore
:Usage:
It's a super short function - just a wrapper really. I understand that I could simply add it to my project and call it a day, but I feel like elf would be much easier to understand for everyone else if we include this function in the elf itself and update docs to encourage people to use it.
This also would not be a breaking change.
Beta Was this translation helpful? Give feedback.
All reactions