raj-fritz
v1.0.1
Published
> [Fritz](https://fritz.work/) bindings for [Raj](https://github.com/andrejewski/raj)
Downloads
2
Maintainers
Readme
Raj Fritz
Installation
yarn add raj-fritz
Usage
import { program } from 'raj-fritz';
import fritz, { h } from 'fritz';
const counterProgram = {
init: [0],
update (message, count) {
switch(message) {
case 'increment':
return [count + 1];
default:
return [count];
}
},
view (count, dispatch) {
return (
<div>
<div>Count: {count}</div>
<button onClick={() => dispatch('increment')}>Click me</button>
</div>
);
}
};
const App = program(fritz.Component, props => counterProgram);
fritz.define('basic-app', App);
Documentation
TODO
License
BSD-2-Clause