Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    ractive-adaptors-ampersandpublic

    Ractive.js Ampersand adaptor

    Use Ampersand State classes (ampersand-state, ampersand-model, ampersand-collection, and ampersand-rest-collection) in your Ractive components.

    Find more Ractive.js plugins at docs.ractivejs.org/latest/plugins

    Installation

    To use this adaptor, you will need to load the script, attach it to your applications Ractive function, and then create Ractive instances that reference it.

    1. Inclusion

    Via script tag: Include ractive-adaptors-ampersand.min.js on your page below Ractive, e.g:

    <script src='lib/ractive.js'></script>
    <script src='lib/ractive-adaptors-ampersand.min.js'></script>

    Via AMD:

    define(['ractive', 'ractive-adaptors-ampersand'],
      function(Ractive, RactiveAdaptorsAmpersand) {
        // See "2. Attaching" below
    });

    Via CommonJS:

    var Ractive = require('ractive');
    var RactiveAdaptorsAmpersand = require('ractive-adaptors-ampersand');
     
    // See "2. Attaching" below

    2. Attaching

    However you include the script, attaching to Ractive will look similar:

    window.Ractive.adaptors.Ampersand = window.RactiveAdaptorsAmpersand;

    3. Activating

    var myRactive = new Ractive({
      adapt: ['Ampersand']
    });

    Keywords

    none

    install

    npm i ractive-adaptors-ampersand

    Downloadsweekly downloads

    4

    version

    0.1.0

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar