Skip to content

Commit

Permalink
Update ko.debug check to support ko 3.4.0+ in debug mode
Browse files Browse the repository at this point in the history
Should fix #41
  • Loading branch information
bago committed Dec 13, 2016
1 parent 87fa4c6 commit afe14ee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dist/ko-reactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ ko['watch'] = function (target, options, evaluatorCallback, context) {

// Subscriptions are stored under either the _subscriptions field for the debug version
// or the F, H or M fields when minified depending on the version used.
// NOTE: we used to use ko.DEBUG to detect the debug versionbut it was removed in 3.4.0+,
// so we now check the existence of a "subscription" function.
var subscriptionsField;
switch (ko.DEBUG || ko.version) {
switch (typeof ko.subscription == 'function' || ko.version) {
case true: subscriptionsField = '_subscriptions'; break;
case "3.0.0": subscriptionsField = 'F'; break;
case "3.1.0": subscriptionsField = 'H'; break;
Expand Down
2 changes: 1 addition & 1 deletion dist/ko-reactor.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ko-reactor",
"author": "Ziad Jeeroburkhan",
"version": "1.3.8",
"version": "1.3.9",
"repository": {
"type": "git",
"url": "https://github.com/ZiadJ/knockoutjs-reactor.git"
Expand Down
4 changes: 3 additions & 1 deletion src/knockout.reactor.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,10 @@ ko['watch'] = function (target, options, evaluatorCallback, context) {

// Subscriptions are stored under either the _subscriptions field for the debug version
// or the F, H or M fields when minified depending on the version used.
// NOTE: we used to use ko.DEBUG to detect the debug versionbut it was removed in 3.4.0+,
// so we now check the existence of a "subscription" function.
var subscriptionsField;
switch (ko.DEBUG || ko.version) {
switch (typeof ko.subscription == 'function' || ko.version) {
case true: subscriptionsField = '_subscriptions'; break;
case "3.0.0": subscriptionsField = 'F'; break;
case "3.1.0": subscriptionsField = 'H'; break;
Expand Down

0 comments on commit afe14ee

Please sign in to comment.