Have ideas to improve npm?Join in the discussion! »

    koboldmaki

    0.1.0 • Public • Published

    Koboldmaki

    Build status

    image

    Views inspired by Backbone, built with components only.

    Installation

    Koboldmaki can be installed with component

    $ component install manuelstofer/koboldmaki
    

    Usage

    It's very similar to Backbone views. One of the main differences is that Koboldmaki views are event emitters. The way to instantiate views is different as well. Koboldmaki is not class based.

    var View = require('koboldmaki');
     
    var MakiAlert = View.extend({
        events: {
            'clicked a': 'hideInTree'
        },
     
        initialize: function () {
            // do something
        },
     
        hideInTree: function () {
            this.el.innerHTML = 'Go koboldmaki, hide in a tree before they catch you!';
        },
     
        render: function () {
            this.el.innerHTML = '<div><a>catch a koboldmaki</a></div>';
        }
    });
     
    var makiAlert = new MakiAlert();
    document.body.appendChild(makiAlert.el);

    Koboldmaki provides a $ method that can query for DOM inside the view's root node using component/query. The $ method does not return any nodes that belong to a nested sub view.

    Keywords

    none

    Install

    npm i koboldmaki

    DownloadsWeekly Downloads

    0

    Version

    0.1.0

    License

    none

    Last publish

    Collaborators

    • avatar