Hacker Newsnew | past | comments | ask | show | jobs | submit | luwes's commentslogin

Hooks are nothing new, it's just repackaging of

https://github.com/dominictarr/observable https://github.com/adamhaile/S

Mobx and Vue use the same technique for running computeds.

As does Solid and Sinuous, etc...


Hooks are much more a reimplementation of the component lifecycle; receiving a change stream is only one of the use cases and has very little resemblance to observables, except that they trigger a re-render “automatically”.


This is fixed in v0.12.3, https://codesandbox.io/s/sinuous-counter-hmp8x

The issue below is still to be fixed. It currently returns an array when it should be a DocumentFragment. It's related to the popular `htm` package that Sinuous uses.

html`${seq.map(i => html`<li>Counter #${i} ${counter}</li>`)}`



@aitchnyu it is similar to Svelte, a lot simpler, early stages, less features though.

I think one of the upsides of Sinuous is that stays much closer to plain JS and to the web standards.


it's indeed not possible, that's why there is a `map` module for rendering lists.


thanks for reporting, seems to be a bug. added to GH issues and will fix asap


@localvoid thanks for the investigation, Sinuous can get around this with the template module I believe.

Also Sinuous doesn't use the same library as Solid or S.js for tracking dependencies. I'll do some investigating if it has the same issue that you posted.


Your library has the same issue. Also, you are using linear search[1] when removing edges.

1. https://github.com/luwes/sinuous/blob/e33c5e8bcdb461be61f7d0...


Thanks for the feedback!

`o` is an alias for `observable`. `observable` can be used as well.

`h` is the pragma, comes from hyperscript. it's used by a lot of libraries as the createElement function name so I didn't think this needed a more descriptive name.


Shamelessly promoting my text selection and range API polyfill, https://github.com/luwes/selection-polyfill

Just to make clear, this would enable Scribe to work in older IE browsers.


Nice! What persuaded you to write this polyfill?


Vitamin D helped me too, it seemed to increase my energy.

It makes sense to add this to your diet if you're working behind a desk indoors most of the day.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: