bind could take an array of state #34
FredericHeem
started this conversation in
Ideas
Replies: 1 comment
-
Thanks for the question! This is a design choice we made in the early days of VanJS. Basically we want to make the interface easier to use, as it aligns with VanJS's goal to reduce the entry barrier of UI programming. Regarding the overhead of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At the moment the bind function takes states and a function as parameters:
bind(state1, state2, (state1, state2)=> {//return a dom})
It would be better for bind to have only 2 parameters: an array of state and the function:
bind([state1, state2], (state1, state2) => {//return a dom})
The bind implementation would be smaller and faster by removing the splice function.
Moreover the typescript definition would be much easier.
The only drawback is that it requires a migration of existing code.
What's your opinion on that subject?
Beta Was this translation helpful? Give feedback.
All reactions