Skip to content
This repository was archived by the owner on Sep 6, 2020. It is now read-only.

nnnnathann/backbone-tadpole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backbone-tadpole

Backbone Tadpole is a tiny set of functions to enable continuous updates from a backend service. Specifically, live collection can help you by handling the polling loops, and adding some default parameters that make supporting polling updates easier on the back end.

Usage

As a Sub-Class

var Tadpole = require('backbone-tadpole');
var MyClass = Tadpole.extend({
  url: '/api/zings',
  initialize: function () {
    this.startPolling({ interval: 1000 });
  }
});
// Will now poll /api/tweets?since=[timestamp]

As a Mixin

var Tadpole = require('backbone-tadpole');
var MyClass = Backbone.Collection.extend(
  _.extend(Tadpole.Mixin, {
    url: '/api/zings',
    initialize: function () {
      this.startPolling({ interval: 2000, data: { user: 'foo' } });
    }
  })
);

API

About

Live Polling for Backbone Collections

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors