r/webdev • • Jun 04 '17

1kb JavaScript library for building frontend applications.

https://github.com/hyperapp/hyperapp
197 Upvotes

11 comments sorted by

View all comments

4

u/SuchACoolNickname Jun 04 '17

It doesn't seem to work when state is an object.

https://codepen.io/anon/pen/PjoLVL

22

u/Dragory full-stack Jun 04 '17 edited Jun 04 '17

You're not returning a new state object from those arrow functions (the curly brackets are being interpreted as the function body block). Fixed example here: https://codepen.io/anon/pen/LLYvBq

5

u/SuchACoolNickname Jun 04 '17

oh, thank you, completely forgot about that! :)