UNPKG

mobx-web-cell

Version:
29 lines (23 loc) 878 B
import {patch as $QdH60$patch} from "web-cell"; import {autorun as $QdH60$autorun} from "mobx"; function $9dc83072d0d4ec0f$var$wrapFunction(func) { return function(props) { var vTree; $QdH60$autorun(()=>vTree = vTree ? $QdH60$patch(vTree, func(props)) : func(props) ); return vTree; }; } function $9dc83072d0d4ec0f$var$wrapClass(Class) { const { update: update } = Class.prototype; Class.prototype.update = function() { $QdH60$autorun(()=>this.isConnected && update.call(this) ); }; } function $9dc83072d0d4ec0f$export$b6ae1bc530f4c149(Class) { if (Object.getPrototypeOf(Class) === Function.prototype) return $9dc83072d0d4ec0f$var$wrapFunction(Class); $9dc83072d0d4ec0f$var$wrapClass(Class); } export {$9dc83072d0d4ec0f$export$b6ae1bc530f4c149 as observer}; //# sourceMappingURL=index.esm.js.map