Repository navigation
|
Hi I am using vanjs creating a jsx-runtime. I found the todo list here. https://vanjs.org/demo#todo-list But still have two problem.
What are your best practices for writing todolists using vanjs? |
Replies: 2 comments 2 replies
|
I have create a easy demo. But it not works fine. After each input in the input box. The list will be re-execute. So I can't do continuous input |
|
Regarding your comments:
VanJS doesn't require your app to be 100% fully reactive. Like mentioned in https://vanjs.org/demo#todo-list, you can choose to build your app in a fully procedural way, a hybrid way between procedural and reactive, or a fully reactive way like the sample app I just demonstrated in this thread, which derives the entire TODO list from a state.
You can definitely extend the |
Hi @cqh963852,
Regarding your demo, you can make the values of the
itemslist nested states ofstring. In this way, theoninputevent handler needs only to update thevaluestate, instead of refreshing the entireitemslist.Thus, your program can be modified like this: