ezel /src/js-example/collections/commits.js

Language Javascript Lines 28
MD5 Hash 40abaf5825975192acb75530f61aaf33
Repository https://github.com/coltonTB/ezel.git View Raw File View Project SPDX
| Open JSFiddle
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//
// Collection for GitHub "commits".
//
// [Sharify](https://github.com/artsy/sharify) lets us require the API url
// and Backbone.sync is replaced with a server-side HTTP module in /lib/setup
// using [Backbone Super Sync](https://github.com/artsy/backbone-super-sync).
// This combined with [browerify](https://github.com/substack/node-browserify)
// makes it simple to share this module in the browser and on the server.
//

var Backbone = require('backbone'),
    sd = require('sharify').data,
    Commit = require('../models/commit');

module.exports = Commits = Backbone.Collection.extend({

  model: Commit,

  url: function() {
    return sd.API_URL + '/repos/' + this.owner + '/' + this.repo + '/commits';
  },

  initialize: function(models, options) {
    this.owner = options.owner;
    this.repo = options.repo;
  }

});
Back to Top