Skip to content

colingourlay/chooet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chooet

All the goodness of choo, multi-threaded by duet.

const chooet = require('chooet');
const html = require('chooet/html');

chooet(choo => {
  app = choo();

  app.model({
    state: { title: 'Not quite set yet' },
    reducers: {
      update: (data, state) => ({ title: data })
    }
  });

  const mainView = (state, prev, send) => html`
    <main>
      <h1>Title: ${state.title}</h1>
      <input
        type="text"
        name="title"
        dataset=${{input: (event, value) => send('update', value.title)}}>
    </main>
  `;

  app.router(route => [
    route('/', mainView)
  ]);

  app.start('body');
});

About

All the goodness of choo, multi-threaded by duet.

Resources

License

Stars

Watchers

Forks

Packages

No packages published