0.0.1 • Published 10 years ago

reactive-skip v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

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