reactive-skip

    0.0.1 • Public • Published

    reactive-skip

    Plugin for reactive to conditionally skip processing of a node and its descendants. Adds a data-skip binding.

    Jump to: Example - Install - License

    Build Status

    Example

    <section data-skip="{ name == 'hank'}">
      <h1 on-click="ignored">hey now</h1>
      <p>no {interpolation} here</p>
    </section>
    <section data-skip="false">
      <h1>{name} is happy</h1>
    </section>
    var reactive = require('reactive')
      , skip = require('reactive-skip')
     
    reactive(template, {name: 'hank'}, {
      bindings: {
        'data-skip': skip.binding
      }
    })

    Alternatively, do:

    var view = reactive(template, {name: 'hank'})
    view.use(skip)

    But note, in this case the template is processed entirely before the plugin is loaded.

    Install

    npm i reactive-skip
    

    Then use browserify to bundle for the browser.

    License

    MIT © Vincent Weevers

    Keywords

    Install

    npm i reactive-skip

    DownloadsWeekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • vweevers