Nifty Penguin Magic

    ubiquisync

    1.0.1 • Public • Published

    npm version

    Ubiquisync

    Sync methods for backbone and ampersand that work in node and the browser.

    Example

    var sync = require('ubiquisync');
    var AmpModel = require('ampersand-model');
    
    
    var Person = AmpModel.extend({
        url: function(){
            var url = 'https://api.example.com/person';
            if(!this.isNew()){
                url = url + '/' + this.id;
            }
            return url;
        },
        props: {
            name: 'string'
        },
        sync: sync    
    });
    
    module.exports = Person;

    ..or something.

    The model can then fetch, save etc both in node and on the browser.

    Keywords

    none

    Install

    npm i ubiquisync

    DownloadsWeekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • dazld