UNPKG

redeux

Version:

Minimal unidirectional data flow utility

34 lines (33 loc) 680 B
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>redeux</title> <script src="./redeux.umd.js"></script> <style> body { padding: 3rem; font-family: sans-serif; } </style> </head> <body> <div id="root"></div> <script> (function(){ var root = document.getElementById('root') store = window.redeux() store.register(todos) function todos(state, action) { return ['redeux'] } console.log('::: STATE :::\n', store()) root.innerHTML = ` <div> <h1>${store().todos[0]}</h1> <p>open the console</p> </div>` }()) </script> </body> </html>