-
Notifications
You must be signed in to change notification settings - Fork 2
Description
A couple of suggestions for the example in the README.
-
Add
/** @jsx h */to the top - just to be explicit, and so newbs don't have to spend time figuring out how to change the default in a.babelrcor something. -
The
whenexample was a bit confusing, since it's actually unnecessary - awirewith a ternary expression would work just as well. Newcomers might perceive this example as "ternaries are not available", which would be a bad, since those are idiomatic to most JSX libraries. I would go with a simple ternary here, which demonstrates reactive expressions - and maybe a separate example with 3 options, maybe color-choices in a drop-down? -
I'd like to see an example of a computed expression here as well - maybe just put the
state.text($).lengthbehind a computed? I actually forget what those even looked like. It's such an important feature, so it would be good to cover this in the example, so people are exposed to it right away. -
I immediately wanted to add
autofocusto that input - which doesn't work, and I guess it can't "just work", since the elements aren't in the DOM at the time when it's being applied? From there, I start wondering about life-cycle events and can I manually focus the input after it's mounted... So this one might be worthy of a separate issue and further discussion.
I only had a short time playing around, as I wasted too much time trying to get CodeSandbox to work properly with .tsx - but this looks really promising and I'm super excited to try this out!
Where are we on map? I had a basic, working implementation in my own toy Sinuous clone here which might help you get the ball rolling - presumably it would need something like the snabbdom diff algorithm?
I know you have quite a bit of work to do on tests and such, but map is likely all that's all that's missing for me to start porting some of my example projects from Sinuous to Haptic, which I would love to do. (If I can find the time, I might try to prototype an implementation of map myself.)
Great work, man! So stoked to see where this goes. 😄