Skip to content

Commit

Permalink
#issue15 - Observable notifications (#16)
Browse files Browse the repository at this point in the history
Fix duplicate observable notifications
  • Loading branch information
guilhermewaess authored and ErikSchierboom committed Jun 4, 2016
1 parent c0397d6 commit 21055dd
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 156 deletions.
3 changes: 2 additions & 1 deletion knockout-paging.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
'default': new DefaultPageGenerator(),
'sliding': new SlidingPageGenerator()
}
}
};

// This extender adds paging functionality to a Knockout observable array.
// The target must be an observable array, otherwise an error is thrown.
Expand Down Expand Up @@ -128,6 +128,7 @@
target.pageItems = ko.pureComputed(function() {
return target().slice(target.firstItemOnPage() - 1, target.lastItemOnPage());
});
target.pageItems.extend({ rateLimit: 1 });

target.pageCount = ko.pureComputed(function() {
if (target.itemCount() <= 0) {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
"gulp-replace": "^0.5.4",
"gulp-uglify": "^1.4.2",
"mocha": "^2.3.3",
"mocha-lcov-reporter": "^1.0.0"
"mocha-lcov-reporter": "^1.0.0",
"sinon": "^1.17.4",
"sinon-chai": "^2.8.0"
},
"dependencies": {
"knockout": "^3.2.0"
Expand All @@ -63,4 +65,4 @@
]
}
}
}
}
Loading

0 comments on commit 21055dd

Please sign in to comment.