Nihilistic Party Mantra

    repeat-brick

    0.0.1 • Public • Published

    Repeat

    Loop over the items of an array store and append bound instances of that element. Repeat is also a plugin for lego.

    Installation

    with component:

    $ component install bredele/repeat-brick
    

    with nodejs:

    $ npm install repeat-brick
    

    Usage

    First, add the plugin to your view (see lego to know more about views):

      var repeat = require('repeat-brick');
     
      view.add('repeat', repeat(view));

    Basic

      <ul repeat>
        <li>{{ attr }}</li>
      </ul>

    the 'li' is repeated for each item into the store (view is a store)

    update the store :

    view.reset([{
      attr: 'bredele',
    }, {
      attr: 'Calgary'
    }])

    and here's the result:

      <ul list>
        <li>bredele</li>
        <li>Calgary</li>    
      </ul>

    See example.

    License

    MIT

    Install

    npm i repeat-brick

    DownloadsWeekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • bredele