1.0.1 • Published 6 years ago

raj-fritz v1.0.1

Weekly downloads
4
License
BSD-2-Clause
Repository
github
Last release
6 years ago

Raj Fritz

Fritz bindings for Raj

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