https://github.com/serebano/bitbox-inferno-component
bitbox inferno component
https://github.com/serebano/bitbox-inferno-component
bitbox inferno-component
Last synced: 3 months ago
JSON representation
bitbox inferno component
- Host: GitHub
- URL: https://github.com/serebano/bitbox-inferno-component
- Owner: serebano
- Created: 2017-05-02T08:08:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-29T07:11:08.000Z (over 7 years ago)
- Last Synced: 2025-02-07T11:09:37.986Z (4 months ago)
- Topics: bitbox, inferno-component
- Language: JavaScript
- Size: 396 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bitbox-inferno-component
https://serebano.github.io/bitbox-inferno-component/```js
/** @jsx h */
import Component, { render } from "bitbox-inferno-component"const Hello = [
function bit({ state, args }, { set, toUpper }) {
return {
value: state.name,
onInput: set(state.name, args[0].target.value(toUpper))
}
},
function box({ onInput, value }, h) {
return (
Hello {value}!
)
}
]const Counter = [
function({ state }, { set, inc, dec }) {
return {
count: state.count(String),
inc: set(state.count, state.count(inc)),
dec: set(state.count, state.count(inc)),
}
},
function Counter({ count, inc, dec }, h) {
return (
{count}
+ inc
- dec
)
}
]function App(props, h) {
return (
)
}render(Component(App, {
state: {
name: 'Scooby Doo',
count: 0
}
}), "#root")```
```
yarn install
yarn start
```