UNPKG

hyperviews

Version:

View template language based targeting hyperscript

20 lines (18 loc) 417 B
<!doctype html> <html> <body> <script src="https://unpkg.com/hyperapp@^1"></script> <script src="view.js"></script> <script> const { h, app } = hyperapp const state = { count: 0 } const actions = { down: () => state => ({ count: state.count - 1 }), up: () => state => ({ count: state.count + 1 }) } app(state, actions, view, document.body) </script> </body> </html>