1.0.2 • Published 2 years ago

hyperdev v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Hyperdev

Install

Install Redux DevTools extension first.

npm i -S hyperdev or yarn add hyperdev

Usage

<!DOCTYPE html>
<html lang="en">
  <head>
    <script type="module">
      import { h, text, app } from 'https://unpkg.com/hyperapp';
      import { withReduxDevTools } from 'https://unpkg.com/hyperdev';

      const inc = state => ({ ...state, counter: state.counter + 1 });

      withReduxDevTools(app)({
        init: { counter: 0 },
        view: state => h('button', { onclick: inc }, text(`Click ${state.counter}`)),
        node: document.getElementById('app'),
      });
    </script>
  </head>

  <body>
    <div id="app"></div>
  </body>
</html>