Skip to content

Instantly share code, notes, and snippets.

@coffee-cup
Created October 23, 2019 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coffee-cup/b1e287df2424d3508a2dbd29b2b27b05 to your computer and use it in GitHub Desktop.
Save coffee-cup/b1e287df2424d3508a2dbd29b2b27b05 to your computer and use it in GitHub Desktop.
import * as React from "react";
import { state, watch, dispatch } from "./model";
import { increaseCount, decreaseCount } from "./actions";
export const App = () => (
<div>
<button onClick={() => dispatch(decreaseCount)()}>-</button>
<h1>Count: {watch(state.count)}</h1>
<button onClick={() => dispatch(increaseCount)()}>+</button>
</div>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment