jorgebucaran / superfine

Absolutely minimal view layer for building web interfaces
https://git.io/super
MIT License
1.57k stars 78 forks source link

Usage of Props #171

Closed kethan closed 5 years ago

kethan commented 5 years ago

How to use props and subscription like in hyperap?

jorgebucaran commented 5 years ago

@kethan Hyperapp subscriptions (declarative layer to manage event streams), is a high-level abstraction not available for Superfine. This library is only a virtual DOM. If you want something like Hyperapp subscriptions, you're free to create your own.

kethan commented 5 years ago

Ok thanks. But how do I use props ?

jorgebucaran commented 5 years ago

@kethan You need to be more specific, your question doesn't make sense without some context.

kethan commented 5 years ago

https://codesandbox.io/s/superfine-92x8l

jorgebucaran commented 5 years ago

@kethan Your virtual DOM requires a root node.

const view2 = html`
  <div>
    <${view} name="test" />
    <${view} name="test" />
  </div>
`;
kethan commented 5 years ago

cool it works. How can I send parameters apart from props something like view (props, state)?

jorgebucaran commented 5 years ago

Maybe this might help https://codepen.io/jorgebucaran/pen/LdLJXX @kethan