bem-promised-models
Advanced tools
Comparing version 0.0.20 to 0.0.21
@@ -897,3 +897,3 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
remove: function () { | ||
throw new Error('.find() is not implemented'); | ||
throw new Error('.remove() is not implemented'); | ||
} | ||
@@ -1002,2 +1002,3 @@ }); | ||
__constructor: function () { | ||
this.LISTEN_BRANCH = 'LISTEN_BRANCH'; | ||
this.__base.apply(this, arguments); | ||
@@ -1082,10 +1083,28 @@ this._initModel(); | ||
_onModelChange: function () { | ||
this._emitChange(); | ||
this._emitChange(true); | ||
}, | ||
/** | ||
* @override | ||
* @param {Boolean} [fromNestedModel=true] do not init listeners | ||
*/ | ||
_emitChange: function (fromNestedModel) { | ||
if (!fromNestedModel) { | ||
//model changed we need to subscribe again | ||
this._initModel(); | ||
} | ||
this.__base(); | ||
}, | ||
/** | ||
* bind to model events | ||
*/ | ||
_initModel: function () { | ||
var prevValue = this._cachBranches[this.LISTEN_BRANCH]; | ||
if (prevValue) { | ||
//unsubscribing | ||
prevValue.un('calculate', this._onModelChange, this); | ||
} | ||
this.value.on('calculate', this._onModelChange, this); | ||
this.commit(this.LISTEN_BRANCH); | ||
} | ||
@@ -1092,0 +1111,0 @@ |
{ | ||
"description": "BEM wrapper for promised-models", | ||
"name": "bem-promised-models", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"repository": "git@github.com:delfrrr/bem-promised-models.git", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"dependencies": { | ||
"promised-models": "0.0.18" | ||
"promised-models": "0.0.19" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57252
1719
+ Addedpromised-models@0.0.19(transitive)
- Removedpromised-models@0.0.18(transitive)
Updatedpromised-models@0.0.19