Skip to content

Commit

Permalink
Add Knockout version check (don't automatically support later version…
Browse files Browse the repository at this point in the history
…s of Knockout).
  • Loading branch information
mbest committed Nov 13, 2013
1 parent 867201f commit 32bcfd2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
13 changes: 10 additions & 3 deletions knockout-deferred-updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @license Deferred Updates plugin for Knockout http://knockoutjs.com/
* (c) Michael Best, Steven Sanderson
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Version 3.0.0
* Version 3.0.1
*/

(function(factory) {
Expand All @@ -19,8 +19,15 @@
}
(function(ko) {

var g = typeof global === "object" && global ? global : window,
undefined = void 0;
var g = typeof global === "object" && global ? global : window;
var undefined;

if (!ko) {
throw Error('Deferred Updates requires Knockout');
}
if (ko.version >= '3.1.0') {
throw Error('This version of Deferred Updates supports Knockout version 3.0 and lower.');
}

/*
* Task manager for deferred tasks
Expand Down
30 changes: 15 additions & 15 deletions knockout-deferred-updates.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "knockout-deferred-updates",
"description": "Deferred Updates plugin for Knockout",
"homepage": "http://mbest.github.io/knockout-deferred-updates/",
"version": "3.0.0",
"version": "3.0.1",
"license": "MIT",
"author": "Michael Best",
"main": "knockout-deferred-updates.js",
Expand All @@ -12,6 +12,6 @@
},
"bugs": "https://github.com/mbest/knockout-deferred-updates/issues",
"dependencies": {
"knockout": ">=3.0.0"
"knockout": "~3.0 || ~2"
}
}

0 comments on commit 32bcfd2

Please sign in to comment.