0.0.5 • Published 6 years ago

kanna v0.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

kanna -- A simple, composable Framework

install

   npm install kanna

usage

  • create HTMLElement
   const {k, mount} = require('kanna');
   mount(document.body, k('h1', {}, ['title']));
  • component
const {k, V, mount} = require('kanna');
const comp = V(({
    props
    }) => {
    return k('h1', {}, [props.text]);
});
mount(document.body, k(comp, {
     text: 'hello'
}));
  • update data
 function getData() {
     return Promise.resolve({
         text: 'kino'
     });
 }
 const comp = V(({
     props,
 }) => {
     return k('h1', {}, [props.text]);
 }, {
     mounted: ({
         props
     }, {
         update
     }) => {
         getData().then(data => {
             update('text', data.text);
         });
     }
 });

 mount(document.body, k(comp, {
     text: ''
 }, []));

test

  • unit test
npm test
  • run example web
npm run server
0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

8 years ago