AutoSponge / set-state

MIT License
6 stars 1 forks source link

Examples of working with arrays and objects #9

Open altteo opened 6 years ago

altteo commented 6 years ago

The best example would be to show to work with array of objects.

AutoSponge commented 6 years ago

@altteo great idea. I have some other commitments I need to do over the next two weeks then I'll come back to this.

altteo commented 6 years ago

Here I was playing with set state. It was not clear how to deal with events, but I figured it out. And also not sure that used set-state with arrays the right way. Here one of my playgrounds, but it is in Imba language :-) : https://scrimba.com/c/c6BeLU2

AutoSponge commented 6 years ago

I have this demo up: https://glitch.com/edit/#!/hyperhtml-set-state?path=script.js:1:0 but it doesn't focus on dealing with arrays of objects (like you might do with an API collection response). That's what I see is missing.

EDIT: I noticed that the version changed for my deps and the demo doesn't work anymore. I'll try to update that too.

altteo commented 6 years ago

Your example at glitch is too complex. Please could you make really basic examples on how manage arrays and arrays of objects (you could write them in the readme)?

And also add some example to readme like that: var some = state(10); state(some).on(function(){...}) because the example with noise is not very helpfull :-)