lib/preact.rb in isomorfeus-preact-10.6.20 vs lib/preact.rb in isomorfeus-preact-10.6.21
- old
+ new
@@ -94,9 +94,23 @@
let length = self.active_redux_components.length;
if (length === 0) { return null; };
return self.active_redux_components[length-1];
};
+ self.register_active_component = function(component) {
+ self.active_components.push(component);
+ if (typeof(component.data_access) === 'function') {
+ self.active_redux_components.push(component);
+ }
+ };
+
+ self.unregister_active_component = function(component) {
+ if (typeof(component.data_access) === 'function') {
+ self.active_redux_components.pop();
+ }
+ self.active_components.pop();
+ };
+
function isObject(obj) { return (obj && typeof obj === 'object'); }
self.merge_deep = function(one, two) {
return [one, two].reduce(function(pre, obj) {
Object.keys(obj).forEach(function(key){