Skip to content

Commit

Permalink
trivial: move RGA#on/off to the bottom of the class.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorendorff committed Apr 12, 2016
1 parent 1a1fc65 commit 5aa49be
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/rga.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,6 @@ RGA.prototype = {
});
},

// Add an event listener. An RGA only emits one kind of event: "op".
on: function (type, callback) {
if (type === "op")
this._subscribers.push(callback);
},

// Remove an event listener.
off: function (type, callback) {
if (type === "op") {
var i = this._subscribers.indexOf(callback);
if (i !== -1)
this._subscribers.splice(i, 1);
}
},

// Return an array of ops that builds the entire document.
history: function () {
var h = [];
Expand Down Expand Up @@ -158,6 +143,21 @@ RGA.prototype = {
return s;
},

// Add an event listener. An RGA only emits one kind of event: "op".
on: function (type, callback) {
if (type === "op")
this._subscribers.push(callback);
},

// Remove an event listener.
off: function (type, callback) {
if (type === "op") {
var i = this._subscribers.indexOf(callback);
if (i !== -1)
this._subscribers.splice(i, 1);
}
},

_log: function () {
if (RGA._logging)
console.log
Expand Down

0 comments on commit 5aa49be

Please sign in to comment.