diff --git a/dist/hyperdis.js b/dist/hyperdis.js index f54c12e..76fe3e9 100644 --- a/dist/hyperdis.js +++ b/dist/hyperdis.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("hyperdis",[],t):"object"==typeof exports?exports.hyperdis=t():e.hyperdis=t()}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n=function(){function e(e,t){for(var r=0;r2?(i=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=null,n=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1]),t=o(y),(e=r=new _(t.fn)).addDependencies.apply(e,P(t.dependencies)),this._addPropInModel(i,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,r)),this}},{key:"_addPropInModel",value:function(e,t){return this._graph.createNodesFrom(t,e),this}},{key:"on",value:function(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"CurrFrame",fn:t});r&&(n=this._graph.stopPropagation().setPropagationOverride("nextFrame")).resetNodeValue.apply(n,P(e));return o}},{key:"next",value:function(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"NextFrame",fn:t});r&&(n=this._graph.stopPropagation().setPropagationOverride("currentFrame")).resetNodeValue.apply(n,P(e));return o}},{key:"lock",value:function(){return this._lockFlag=!0,this._reqQ.length=0,this}},{key:"unlock",value:function(){return this._lockFlag=!1,this.setProp.apply(this,P(this._reqQ)),this._reqQ.length=0,this}},{key:"prop",value:function(){var e,t=void 0,r=void 0;switch(e=arguments.length){case 1:t=arguments.length<=0?void 0:arguments[0];break;case 2:t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1];break;default:return this}return 2===e?(this._lockFlag?this._reqQ.push([t,r]):this.setProp([t,r]),this):this._graph.getNodeValue(t)}},{key:"setProp",value:function(){for(var e,t=this,r=arguments.length,n=Array(r),i=0;i2?(i=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],o=arguments.length<=2?void 0:arguments[2]):(i=null,n=arguments.length<=0?void 0:arguments[0],o=arguments.length<=1?void 0:arguments[1]),t=o(y),(e=r=new b(t.fn)).addDependencies.apply(e,A(t.dependencies)),this._addPropInModel(i,function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({},n,r)),this}},{key:"_addPropInModel",value:function(e,t){return this._graph.createNodesFrom(t,e),this}},{key:"on",value:function(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"CurrFrame",fn:t});r&&(n=this._graph.stopPropagation().setPropagationOverride("nextFrame")).resetNodeValue.apply(n,A(e));return o}},{key:"next",value:function(e,t,r){var n,i=e instanceof Array?e:[e],o=this._graph.createElectricNodeOf(i,{type:"NextFrame",fn:t});r&&(n=this._graph.stopPropagation().setPropagationOverride("currentFrame")).resetNodeValue.apply(n,A(e));return o}},{key:"lock",value:function(){return this._lockFlag=!0,this._reqQ.length=0,this}},{key:"unlock",value:function(){return this._lockFlag=!1,this.setProp(this._reqQ),this._reqQ.length=0,this}},{key:"prop",value:function(){var e,t=void 0,r=void 0;switch(e=arguments.length){case 1:t=arguments.length<=0?void 0:arguments[0];break;case 2:t=arguments.length<=0?void 0:arguments[0],r=arguments.length<=1?void 0:arguments[1];break;default:return this}return 2===e?(this._lockFlag?this._reqQ.push([t,r]):this.setProp([[t,r]]),this):this._graph.getNodeValue(t)}},{key:"setProp",value:function(e){var t=this;return 0===e.length?this:(this._graph.update(e.map(function(e){return[t._graph.getNodeFromQualifiedName(e[0]),e[1]]})),this)}},{key:"graph",value:function(){return this._graph}},{key:"serialize",value:function(){return this._graph.root.seed}}],[{key:"create",value:function(t){return(new e)._addPropInModel(null,t)}}]),e}();t.default=x}])}); //# sourceMappingURL=hyperdis.js.map \ No newline at end of file diff --git a/dist/hyperdis.js.map b/dist/hyperdis.js.map index 285766b..b521a40 100644 --- a/dist/hyperdis.js.map +++ b/dist/hyperdis.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://hyperdis/webpack/universalModuleDefinition","webpack://hyperdis/webpack/bootstrap","webpack://hyperdis/./src/utils/set.js","webpack://hyperdis/./src/utils/index.js","webpack://hyperdis/./src/graph-node.js","webpack://hyperdis/./src/electric-node.js","webpack://hyperdis/./src/graph.js","webpack://hyperdis/./src/model.js","webpack://hyperdis/./src/index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","makeEntry","arr","sCon","forEach","elem","undefined","ForeignSet","_classCallCheck","this","_set","keys","set1","set2","filteredKeys","s1","s2","push","isSimpleObject","obj","_typeof","toString","constructor","match","win","reqAnimFrame","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","callback","setTimeout","getTimeBasedId","__lastTime","Date","getTime","__id","flat","_len","arguments","length","params","Array","_key","res","param","apply","_toConsumableArray","scheduler","onFinishCallback","queue","animationFrame","listeners","payload","tempQ","slice","fns","reduce","store","fn","map","unique","fetch","namedNode","_len2","_key2","node","qualifiedName","seed","fetchAggregator","_len3","_key3","dependencies","getUpstreamNodes","list","rec","qname","placedIndex","preArr","postArr","concat","outgoingEdges","resolver","accumulate","_len4","_key4","resp","nodeDetails","assign","_defineProperty","identity","CustomResolver","utils_classCallCheck","dep","_dep","GraphNode","options","graph_node_classCallCheck","edges","_seed","requireResolve","retriever","history","electricEdges","_edges","_this","entry","graph_node_toConsumableArray","retrieveDetails","edge","head","hist","ElectricNode","electric_node_classCallCheck","nextFrame","currentFrame","lstnrs","index","nodes","nFn","pullableRecent","filter","_this2","pullableEnd","Graph","graph_classCallCheck","qualifiedNodeMap","graph_node","_wholeSet","_propagate","propagationOverride","currentFrameListeners","nextFrameListeners","_schedule","flushTarget","flush","mount","val","resolveReqList","objn","perv","addDependencies","_node","graph_toConsumableArray","getDependencies","set","getResolvedList","resolve","prop","props","fnSpec","_ref","eNode","electric_node","addEdges","addElectricNode","type","changedSet","upstreamNodes","upstreamNode","append","__execUniqueElectricEdges","from","Set","_this3","cfLstnrs","nfLstnrs","difference","toArray","repeatHead","e","resetPropagationOverride","_this4","qnames","args","update","resolved","resolveDependencyOrder","resolveMap","neighbour","isRoot","model","Model","model_classCallCheck","_graph","graph","_lockFlag","_reqQ","mountPoint","_addPropInModel","_customResolver","calculationConfig","customResolver","varName","fetchFn","model_toConsumableArray","model_defineProperty","createNodesFrom","instantCall","_graph$stopPropagatio","propsArr","unsub","createElectricNodeOf","stopPropagation","setPropagationOverride","resetNodeValue","_graph$stopPropagatio2","setProp","len","getNodeValue","getNodeFromQualifiedName","__webpack_exports__"],"mappings":"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L,OAAOyB,aAAa7D,qCAIjB,QAAAoC,EAAA/E,EAAAjG,KAAA8B,EAAAC,UAAAC,OAAP6G,EAAO3G,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAP0G,EAAO1G,GAAAJ,UAAAI,GAMf,OAAqB,IAAjB0G,EAAM7G,OACChC,OAGXgL,EAAAhL,KAAKgL,QAAOT,OAAZjI,MAAA0I,EAAAW,EAAsB9C,EAAMzF,IAAI,SAAAwF,GAAA,OAAS3C,EAAK+E,OAAO0B,yBAAyB9D,EAAK,IAAKA,EAAK,QACtF5I,sCAQP,OAAOA,KAAKgL,2CASZ,OAAOhL,KAAKgL,OAAOlO,KAAK8G,sCA5SblD,GACX,OAAO,IAAIoK,GAAQO,gBAAgB,KAAM3K,YC1BjDiM,EAAA","file":"hyperdis.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"hyperdis\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"hyperdis\"] = factory();\n\telse\n\t\troot[\"hyperdis\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const makeEntry = (arr, sCon) => {\n arr.forEach((elem) => {\n if (elem === undefined || elem === null) {\n return;\n }\n sCon[elem] = 1;\n });\n};\n\nexport default class ForeignSet {\n constructor (arr) {\n this._set = {};\n makeEntry(arr, this._set);\n }\n\n append (arr) {\n makeEntry(arr, this._set);\n return this;\n }\n\n toArray () {\n return Object.keys(this._set);\n }\n\n static difference (set1, set2) {\n let key;\n const filteredKeys = [],\n s1 = set1._set,\n s2 = set2._set;\n for (key in s1) {\n if (!({}).hasOwnProperty.call(s1, key)) {\n continue;\n }\n if (key in s2) {\n continue;\n }\n filteredKeys.push(key);\n }\n return new ForeignSet(filteredKeys);\n }\n}\n","/* global window */\n\nimport ForeignSet from './set';\n\nconst\n isSimpleObject = (obj) => {\n let token;\n if (typeof obj === 'object') {\n if (obj === null) { return false; }\n token = Object.prototype.toString.call(obj);\n if (token === '[object Object]') {\n return (obj.constructor.toString().match(/^function (.*)\\(\\)/m) || [])[1] === 'Object';\n }\n }\n return false;\n },\n minMsThreshold = 16,\n /* istanbul ignore next */win = typeof window === 'undefined' ? (this || {}) : window,\n /* istanbul ignore next */ reqAnimFrame = win.requestAnimationFrame || win.webkitRequestAnimationFrame ||\n win.mozRequestAnimationFrame || win.oRequestAnimationFrame ||\n win.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, minMsThreshold);\n },\n\n getTimeBasedId = () => {\n if (getTimeBasedId.__lastTime === new Date().getTime()) {\n return (getTimeBasedId.__lastTime).toString() + (getTimeBasedId.__id++).toString();\n }\n\n getTimeBasedId.__id = 0;\n getTimeBasedId.__lastTime = new Date().getTime();\n return (getTimeBasedId.__lastTime).toString() + (getTimeBasedId.__id++).toString();\n },\n pullableRecent = (nodes, fn) => {\n let nFn = () => {\n fn(...nodes.map((node) => {\n const\n hist = node.history,\n l = hist.length - 1;\n return [hist[l - 1 < 0 ? 0 : l - 1], hist[l]];\n }));\n };\n nFn.__id = getTimeBasedId();\n return nFn;\n },\n pullableEnd = (nodes, fn) => {\n let nFn = () => {\n fn(...nodes.map((node) => {\n const hist = node.history;\n return [hist[0], hist[hist.length - 1]];\n }));\n };\n nFn.__id = getTimeBasedId();\n return nFn;\n },\n unique = fns => fns\n .reduce((store, fn) => {\n // @warn function with side effect, it mutates the store passed during initialization\n if (fn.__id in store.map) {\n return store;\n }\n\n store.map[fn.__id] = 1;\n store.unique.push(fn);\n\n return store;\n }, { map: {}, unique: [] })\n .unique,\n compose = fns => () => {\n fns.forEach(fn => fn());\n },\n flat = (...params) => {\n const res = [];\n params.forEach(param => res.push(...param));\n return res;\n },\n identityMap = arrays => arrays,\n splitPathProp = (path) => {\n const pathArr = path.split('.'),\n len = pathArr.length;\n return [pathArr.slice(0, len - 1), pathArr[len - 1]];\n },\n scheduler = (onFinishCallback) => {\n let queue = [],\n animationFrame = null;\n\n onFinishCallback = onFinishCallback &&\n typeof onFinishCallback === 'function' && onFinishCallback || (() => { });\n\n return (listeners, payload) => {\n [].push.apply(queue, listeners);\n if (animationFrame === null) {\n animationFrame = reqAnimFrame(() => {\n const tempQ = queue.slice(0);\n queue.length = 0;\n animationFrame = null;\n\n unique(tempQ).forEach(fn => fn());\n onFinishCallback(payload);\n });\n }\n };\n },\n fetch = namedNode => (...params) => params.map((param) => {\n const node = namedNode[param];\n return {\n name: node.name,\n qualifiedName: node.qualifiedName,\n value: node.seed\n };\n }),\n fetchAggregator = (...params) => ({\n dependencies: params.slice(0, params.length - 1),\n fn: params[params.length - 1]\n }),\n getUpstreamNodes = (list) => {\n let res = [];\n const map = {};\n list.forEach(node => map[node.qualifiedName] = -1);\n function rec (arr) {\n arr.forEach((node) => {\n let qname,\n placedIndex,\n preArr,\n postArr;\n if (!((qname = node.qualifiedName) in map)) {\n map[qname] = res.push(node) - 1;\n } else {\n placedIndex = map[qname];\n if (placedIndex !== -1 && placedIndex !== res.length - 1) {\n // If not the last element, readjust the array so that the later dependency position is saved\n preArr = res.slice(0, placedIndex);\n postArr = res.slice(placedIndex + 1);\n res = preArr.concat(postArr);\n\n // reset the index in map\n postArr.forEach((elem, i) => map[elem.qualifiedName] = i + preArr.length);\n map[qname] = res.push(node) - 1;\n }\n }\n rec(node.outgoingEdges);\n });\n }\n rec(list);\n return res;\n },\n resolver = {\n accumulate: (...params) => {\n const resp = {};\n params.forEach((nodeDetails) => {\n Object.assign(resp, { [nodeDetails.name]: nodeDetails.value });\n });\n return resp;\n },\n identity: nodeDetails => nodeDetails.value\n };\n\nfunction resolveDependencyOrder (node, resolved, resolveMap) {\n let qname;\n node.edges.forEach((neighbour) => {\n resolveDependencyOrder(neighbour, resolved, resolveMap);\n });\n\n if (node.isRoot() || (qname = node.qualifiedName) in resolveMap) {\n return;\n }\n resolved.push(node);\n resolveMap[qname] = 1;\n}\n\nclass CustomResolver {\n constructor (resolver) {\n this.fn = resolver;\n this.dep = [];\n }\n\n addDependencies(...dep) {\n this.dep.push(...dep);\n return this;\n }\n\n getDependencies () {\n return this.dep;\n }\n\n get () {\n return this.fn;\n }\n}\n\nexport {\n isSimpleObject,\n scheduler,\n compose,\n flat,\n identityMap,\n pullableEnd,\n pullableRecent,\n unique,\n splitPathProp,\n resolver,\n ForeignSet,\n resolveDependencyOrder,\n fetch,\n fetchAggregator,\n CustomResolver,\n getUpstreamNodes\n};\n","export default class GraphNode {\n constructor (name, qualifiedName, options) {\n /* istanbul ignore next */options = options || {};\n this.name = name;\n this.qualifiedName = qualifiedName;\n this.edges = [];\n this.outgoingEdges = [];\n this._seed = null;\n this.requireResolve = true;\n this.retriever = options.retriever;\n this.history = [];\n this.resolver = null;\n this.electricEdges = [];\n }\n\n addDependencies (...dep) {\n this.edges.push(...dep);\n dep.forEach(entry => entry.outgoingEdges.push(this));\n return this;\n }\n\n addElectricNode (node) {\n this.electricEdges.push(node);\n return this;\n }\n\n get seed () {\n return this._seed;\n }\n\n set seed (value) {\n this._seed = value;\n this.requireResolve = true;\n return this;\n }\n\n resolve () {\n this.seed = this.resolver(...this.retrieveDetails());\n this.history.push(this.seed);\n this.requireResolve = false;\n return this;\n }\n\n retrieveDetails () {\n if (this.edges.length === 0) {\n return [{\n name: this.name,\n qualifiedName: this.qualifiedName,\n value: this.seed\n }];\n }\n return this.retriever(...this.edges.map(edge => edge.qualifiedName));\n }\n\n repeatHead () {\n const\n history = this.history,\n head = history[history.length - 1];\n // @todo- Akash, write test case if history.length === 0 to pass code coverage\n if (history.length === 0) {\n return this;\n }\n history.push(head);\n return this;\n }\n\n flush () {\n const hist = this.history,\n head = hist[hist.length - 1];\n hist.length = 0;\n hist.push(head);\n return this;\n }\n\n isRoot () {\n return this.name === null;\n }\n}\n","import {\n pullableRecent,\n pullableEnd\n} from './utils';\n\nexport default class ElectricNode {\n constructor () {\n this.edges = [];\n this.listeners = {\n nextFrame: [],\n currentFrame: []\n };\n }\n\n addEdges (...nodes) {\n this.edges.push(...nodes);\n return this;\n }\n\n regListenerForCurrFrame (fn) {\n const lstnrs = this.listeners.currentFrame;\n let index = lstnrs.push(pullableRecent(this.edges, fn)) - 1;\n\n return () => {\n this.listeners.currentFrame = lstnrs.filter((fn, i) => i !== index);\n };\n }\n\n regListenerForNextFrame (fn) {\n const lstnrs = this.listeners.nextFrame;\n let index = lstnrs.push(pullableEnd(this.edges, fn)) - 1;\n\n return () => {\n this.listeners.nextFrame = lstnrs.filter((fn, i) => i !== index);\n };\n }\n\n hasNextFrameListener () {\n return !!this.listeners.nextFrame.length;\n }\n}\n","import {\n isSimpleObject,\n resolver,\n // upstreamNodes,\n flat,\n resolveDependencyOrder,\n getUpstreamNodes,\n ForeignSet,\n fetch,\n CustomResolver,\n scheduler\n} from './utils';\nimport Node from './graph-node';\nimport ElectricNode from './electric-node';\n\nexport default class Graph {\n constructor () {\n this.qualifiedNodeMap = {};\n this.retriever = fetch(this.qualifiedNodeMap);\n this.root = new Node(null, null, { retriever: this.retriever });\n this.root.resolver = resolver.accumulate;\n\n this._wholeSet = null;\n this._propagate = true;\n this.propagationOverride = {\n currentFrameListeners: false,\n nextFrameListeners: false\n };\n\n this._schedule = scheduler((payload) => {\n let qname;\n for (qname in payload.flushTarget) {\n if (!({}).hasOwnProperty.call(this.qualifiedNodeMap, qname)) {\n return;\n }\n this.qualifiedNodeMap[qname].flush();\n }\n });\n }\n\n createNodesFrom (obj, mount) {\n let val,\n resolveReqList;\n const qualifiedNodeMap = this.qualifiedNodeMap,\n root = this.root,\n retriever = this.retriever;\n\n (function rec (objn, qualifiedName, history) {\n let key,\n qname,\n perv,\n node;\n\n for (key in objn) {\n if (!({}).hasOwnProperty.call(objn, key)) {\n continue;\n }\n qname = `${qualifiedName}${key}`;\n node = new Node(key, qname, { retriever });\n qualifiedNodeMap[qname] = node;\n\n if ((perv = history.perv) !== undefined) {\n perv.addDependencies(node);\n } else {\n // top most level entries\n root.addDependencies(node);\n }\n\n if (isSimpleObject(val = objn[key])) {\n rec(val, `${qualifiedName}${key}.`, { perv: node });\n node.resolver = resolver.accumulate;\n } else if (val instanceof CustomResolver) {\n node.resolver = val.get();\n node.addDependencies(...val.getDependencies().map(qname => qualifiedNodeMap[qname]));\n } else {\n node.resolver = resolver.identity;\n node.seed = val;\n // node.resolve();\n }\n }\n }(obj, mount === null ? '' : `${mount}.`, {\n perv: qualifiedNodeMap[mount]\n }));\n\n this._wholeSet = new ForeignSet(Object.keys(this.qualifiedNodeMap));\n\n // Recalculate the model without firing the listeners\n // @todo selective branch resolve. Currently resolve gets called even for a branch which was updated\n resolveReqList = this.constructor.getResolvedList(root).concat(root).filter(node => node.requireResolve);\n resolveReqList.forEach(node => node.resolve());\n getUpstreamNodes(resolveReqList).forEach(node => node.resolve());\n return this;\n }\n\n getNodeValue (prop) {\n if (prop in this.qualifiedNodeMap) {\n return this.qualifiedNodeMap[prop].seed;\n }\n return undefined;\n }\n\n createElectricNodeOf (props, fnSpec) {\n const nodes = props.map(prop => this.qualifiedNodeMap[prop]),\n eNode = new ElectricNode().addEdges(...nodes);\n\n nodes.forEach(node => node.addElectricNode(eNode));\n return eNode[`regListenerFor${fnSpec.type}`](fnSpec.fn);\n }\n\n update (...params) {\n let changedSet,\n upstreamNodes;\n const\n electricEdges = [],\n nodes = params.map((entry) => {\n entry[0].seed = entry[1];\n return entry[0];\n });\n nodes.forEach(node => node.resolve());\n electricEdges.push(...flat(...nodes.map(node => node.electricEdges)));\n changedSet = new ForeignSet(nodes.map(node => node.qualifiedName));\n\n if (!this._propagate) {\n this.__execUniqueElectricEdges(electricEdges);\n this._propagate = true;\n return this;\n }\n\n upstreamNodes = getUpstreamNodes(nodes);\n upstreamNodes.forEach(upstreamNode => upstreamNode.resolve());\n changedSet.append(upstreamNodes.map(node => node.qualifiedName));\n electricEdges.push(...flat(...upstreamNodes.map(node => node.electricEdges)));\n\n this.__execUniqueElectricEdges(Array.from(new Set(electricEdges)), changedSet);\n return this;\n }\n\n __execUniqueElectricEdges (electricEdges, changedSet) {\n const\n cfLstnrs = [], // current frame listeners\n nfLstnrs = []; // next frame listeners\n if (changedSet) {\n const\n differenceSet = ForeignSet.difference(this._wholeSet, changedSet),\n entries = differenceSet.toArray();\n\n entries.forEach(entry => this.qualifiedNodeMap[entry].repeatHead());\n }\n\n electricEdges.forEach((e) => {\n cfLstnrs.push(...e.listeners.currentFrame);\n });\n electricEdges.forEach((e) => {\n nfLstnrs.push(...e.listeners.nextFrame);\n });\n\n !this.propagationOverride.currentFrameListeners && cfLstnrs.forEach(fn => fn());\n !this.propagationOverride.nextFrameListeners && this._schedule(nfLstnrs, { flushTarget: changedSet });\n this.resetPropagationOverride();\n return this;\n }\n\n resetNodeValue (...qnames) {\n const nodes = qnames.map(qname => this.qualifiedNodeMap[qname]),\n args = nodes.map(node => [node, node.seed]);\n this.update(...args);\n return this;\n }\n\n static getResolvedList (node) {\n const resolved = [];\n resolveDependencyOrder(node, resolved, {});\n return resolved;\n }\n\n stopPropagation () {\n this._propagate = false;\n return this;\n }\n\n resetPropagationOverride () {\n this.propagationOverride.currentFrameListeners = false;\n this.propagationOverride.nextFrameListeners = false;\n return this;\n }\n\n setPropagationOverride (key) {\n this.propagationOverride[`${key}Listeners`] = true;\n return this;\n }\n\n getNodeFromQualifiedName (qname) {\n return this.qualifiedNodeMap[qname];\n }\n}\n","import Graph from './graph';\nimport { CustomResolver, fetchAggregator } from './utils';\n\n/**\n * The container class for Hyperdis. Hyperdis is an enabler for observable object with few interesting features like,\n * calculated property, next frame and same frame listeners, multiple listeners etc with a dependency resolving system.\n * It internally uses a graph to hold the hierarchial relationship of a object. Model is merely a container which\n * ties all the components together.\n *\n * @todo Circular dependency detection is not present\n *\n * @example check src/index.spec.js\n * @class\n */\nclass Model {\n constructor () {\n this._graph = new Graph();\n this._lockFlag = false;\n this._reqQ = [];\n }\n\n /**\n * Static method to create and init the model with an observable seed\n *\n * @param {Object} obj The target object which is required to be made observable\n * @return {Model} instance of the observable object model\n */\n static create (obj) {\n return new Model()._addPropInModel(null, obj);\n }\n\n /**\n * Appends more observable property on the already observable instance. This mutates the original model.\n *\n * This function works in two mode. One being\n * @param {String} mountPoint the property on which the new set of properties will be mounted. If its a nested\n * property then the mountPoint has to be written such a way so it feels like you are\n * accessing the object. If the mount point is not found then he obeservables are added in\n * the root.\n * @param {Object} The target object which is required to be made observable\n *\n * Another being\n * @param {Object} The target object which is required to be made observable\n *\n * @return {Model} instance of the observable object model\n */\n append (...params) {\n let mountPoint,\n obj;\n\n if (params.length === 1) {\n mountPoint = null;\n obj = params[0];\n } else {\n mountPoint = params[0];\n obj = params[1];\n }\n\n this._addPropInModel(mountPoint, obj);\n return this;\n }\n\n /**\n * Creates a calculated variable from existing variable. This variable can't be updated from outside.\n * @param {string} mountpoint property path on which the new variable will be placed\n * @param {string} name name of the variable. If the variable could have hierarchy like `limits.start`\n * @param {Function} fn funtion where the dependent variables are injected based on the dependency requirement\n */\n calculatedProp (...params) {\n let calculationConfig,\n customResolver,\n varName,\n mount,\n fetchFn;\n\n if (params.length > 2) {\n mount = params[0];\n varName = params[1];\n fetchFn = params[2];\n } else {\n mount = null;\n varName = params[0];\n fetchFn = params[1];\n }\n\n calculationConfig = fetchFn(fetchAggregator);\n customResolver = new CustomResolver(calculationConfig.fn);\n customResolver.addDependencies(...calculationConfig.dependencies);\n\n this._addPropInModel(mount, { [varName]: customResolver });\n return this;\n }\n\n // eslint-disable-next-line require-jsdoc\n _addPropInModel (mountPoint, obj) {\n this._graph.createNodesFrom(obj, mountPoint);\n return this;\n }\n\n /**\n * Register a listener in the current frame when a property or group of properties is changed.\n *\n * @example\n * This function takes a single or group of property and handler which is called when any of the properties are\n * changed.\n * When a single property is changed the handler is called with two parameter, what was the old value of the state\n * property and what is the new value.\n * myState.on('range.start', (oldValue, newValue) => {\n * console.log('Value before prop change', oldValue);\n * console.log('Value after prop change', newValue);\n * });\n *\n * myState.prop('range.start', 9);\n * // Output\n * Value before prop change 1\n * Value after prop change 9\n *\n * If a handler is registered on change of a property which has another state property as value, then the handler\n * gets called whenever any state property connected to it gets changed\n *\n * myState.on('range', (oldValue, newValue) => {\n * console.log('Value before prop change', oldValue);\n * console.log('Value after prop change', newValue);\n * });\n *\n * myState.prop('range.start', 10);\n * myState.prop('range.type.absolute', false);\n *\n * // Output\n * Value before prop change\n * range {\n * start: 9,\n * end: 5,\n * type: {\n * absolute: true\n * }\n * }\n * Value after prop change\n * range: {\n * start: 10,\n * end: 5,\n * type: {\n * absolute: false\n * }\n * }\n * If a handler is registered with more than one property change then, the handler is called when any of the\n * properties gets changed. In this cast the handler is called with more than one parameter: each for one state\n * property which is registered for listening. Each parameter is of type array containing [oldValue, newValue]\n *\n * myState.on('range.start', 'range.end', (start, end) => {\n * console.log('Start', start);\n * console.log('End', end);\n * });\n *\n * myState.prop('range.start', 12);\n *\n * // Output\n * Start [10, 12]\n * End [5, 5]\n *\n * myState.prop('range.end', 7);\n *\n * // Output\n * Start [12, 12]\n * End [5, 7]\n *\n * The on returns a function which is when called the listener registered gets unregistered\n *\n * let unsub = myState.on(['range.start', 'range.end'], (start, end) => {\n * console.log('Start', start);\n * console.log('End', end);\n * });\n *\n * // Unsubscribe\n * unsub()\n *\n * On takes an optional boolean value as the last parameter, which if passed as a true value the handler gets called\n * during registration itself.\n *\n * @param {Array.} props List of properties which is of interest\n * @param {Function} fn Listener to be executed when any of them is changed. The listener is called with the old\n * value and new value of the properties\n * @param {*} instantCall When registered if the function is to be triggered with the value of the property\n *\n * @return {Function} function to unsubscribe from the listeners registry\n */\n on (props, fn, instantCall) {\n const\n propsArr = props instanceof Array ? props : [props],\n // All there listeners will be executed in the current stack frame\n unsub = this._graph.createElectricNodeOf(propsArr, {\n type: 'CurrFrame',\n fn\n });\n\n if (instantCall) {\n // Bar current next frame listeners from getting fired\n this._graph.stopPropagation().setPropagationOverride('nextFrame').resetNodeValue(...props);\n }\n return unsub;\n }\n\n /**\n * Register a listener for the next frame when a property or group of properties is changed.\n *\n * @example\n * See the examples for the on listener\n *\n * @param {Array.} props List of properties which is of interest\n * @param {Function} fn Listener to be executed when any of them is changed. The listener is called with the old\n * value and new value of the properties. Here the oldvalue is last value of the last frame\n * @param {*} instantCall When registered if the function is to be triggered with the value of the property\n *\n * @return {Function} function to unsubscribe from the listeners registry\n */\n next (props, fn, instantCall) {\n const\n propsArr = props instanceof Array ? props : [props],\n // All there listeners will be executed at the tick of next animation frame\n unsub = this._graph.createElectricNodeOf(propsArr, {\n type: 'NextFrame',\n fn\n });\n\n // @todo check support for this from the graph side\n if (instantCall) {\n // Bar current frame listeners from getting fired\n this._graph.stopPropagation().setPropagationOverride('currentFrame').resetNodeValue(...props);\n }\n\n return unsub;\n }\n\n /**\n * Lock queues the request of property change and releases the change when unlock is called. This is helpful when\n * multiple property is getting called and the model listeners are to be fired once at the end of update.\n *\n * @return {Model} instance of the model\n */\n lock () {\n this._lockFlag = true;\n this._reqQ.length = 0;\n return this;\n }\n\n /**\n * Unlock unleashes the change done after the lock was called.\n\n * @return {Model} instance of the model\n */\n unlock () {\n this._lockFlag = false;\n this.setProp(...this._reqQ);\n this._reqQ.length = 0;\n return this;\n }\n\n /**\n * This acts as getter and setter. If the function is called by passing only one argument, it retrieve the value\n * associated with the property. If the same function is called using two parameters, first one being the property\n * and second one being the value, then the value is set for the property and the handlers are called (if any)\n * which got registered using the on function\n *\n * Getter\n * @param {string} prop property path whose value to be retrieved\n * @return {Object} value of the property at the time of call\n *\n * Setter\n * @param {string} property property path whose value to be ser\n * @return {Model} instance of the model\n */\n prop (...params) {\n let prop,\n val,\n len;\n\n switch (len = params.length) {\n case 1:\n prop = params[0];\n break;\n\n case 2:\n prop = params[0];\n val = params[1];\n break;\n\n default:\n return this;\n }\n\n if (len === 2) {\n this._lockFlag ? this._reqQ.push([prop, val]) : this.setProp([prop, val]);\n return this;\n }\n\n return this._graph.getNodeValue(prop);\n }\n\n // eslint-disable-next-line require-jsdoc\n setProp (...props) {\n // Filter out the calculated variables, so that it cant be changed from outside\n // @todo if a node is not leafValue, and change is called, ignore it too\n // props = props.filter(prop => !(VirtualObj.walkTill(prop[0].split('.'), this._vObj).leafValue()\n // instanceof CalculatedVar));\n\n if (props.length === 0) {\n return this;\n }\n\n this._graph.update(...props.map(prop => [this._graph.getNodeFromQualifiedName(prop[0]), prop[1]]));\n return this;\n }\n\n /**\n * Retrieves the graph representation of the object\n * @return {Graph} instance of the graph associated to the model\n */\n graph () {\n return this._graph;\n }\n\n /**\n * Get serialized data from the model\n *\n * @return {Object} Serialized data\n */\n serialize () {\n return this._graph.root.seed;\n }\n}\n\nexport default Model;\n","import Model from './model';\n\nexport default Model;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://hyperdis/webpack/universalModuleDefinition","webpack://hyperdis/webpack/bootstrap","webpack://hyperdis/./src/utils/set.js","webpack://hyperdis/./src/utils/index.js","webpack://hyperdis/./src/graph-node.js","webpack://hyperdis/./src/electric-node.js","webpack://hyperdis/./src/graph.js","webpack://hyperdis/./src/model.js","webpack://hyperdis/./src/index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","makeEntry","arr","sCon","forEach","elem","undefined","ForeignSet","_classCallCheck","this","_set","keys","set1","set2","filteredKeys","s1","s2","push","isSimpleObject","obj","_typeof","toString","constructor","match","win","reqAnimFrame","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","callback","setTimeout","getTimeBasedId","__lastTime","Date","getTime","__id","flat","params","res","param","apply","_toConsumableArray","scheduler","onFinishCallback","queue","animationFrame","listeners","payload","tempQ","slice","length","fns","reduce","store","fn","map","unique","fetch","namedNode","_len","arguments","Array","_key","node","qualifiedName","seed","fetchAggregator","_len2","_key2","dependencies","getUpstreamNodes","list","rec","qname","placedIndex","preArr","postArr","concat","outgoingEdges","resolver","accumulate","_len3","_key3","resp","nodeDetails","assign","_defineProperty","identity","CustomResolver","utils_classCallCheck","dep","_dep","GraphNode","options","graph_node_classCallCheck","edges","_seed","requireResolve","retriever","history","electricEdges","_edges","_this","entry","graph_node_toConsumableArray","retrieveDetails","edge","head","hist","ElectricNode","electric_node_classCallCheck","nextFrame","currentFrame","lstnrs","index","nodes","nFn","pullableRecent","filter","_this2","pullableEnd","Graph","graph_classCallCheck","qualifiedNodeMap","graph_node","_wholeSet","_propagate","propagationOverride","currentFrameListeners","nextFrameListeners","_schedule","flushTarget","flush","mount","val","resolveReqList","objn","perv","addDependencies","_node","graph_toConsumableArray","getDependencies","set","getResolvedList","resolve","prop","props","fnSpec","_ref","eNode","electric_node","addEdges","addElectricNode","type","changedSet","upstreamNodes","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","next","done","err","return","__execUniqueElectricEdges","upstreamNode","append","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","from","Set","_this3","cfLstnrs","nfLstnrs","difference","toArray","repeatHead","e","resetPropagationOverride","_this4","qnames","args","update","resolved","resolveDependencyOrder","resolveMap","neighbour","isRoot","model","Model","model_classCallCheck","_graph","graph","_lockFlag","_reqQ","mountPoint","_addPropInModel","_customResolver","calculationConfig","customResolver","varName","fetchFn","model_toConsumableArray","model_defineProperty","createNodesFrom","instantCall","_graph$stopPropagatio","propsArr","unsub","createElectricNodeOf","stopPropagation","setPropagationOverride","resetNodeValue","_graph$stopPropagatio2","setProp","len","getNodeValue","getNodeFromQualifiedName","__webpack_exports__"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,cAAAH,GACA,iBAAAC,QACAA,QAAA,SAAAD,IAEAD,EAAA,SAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,EAAA,cAAiDyB,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAAnB,EAAAmB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFAxB,EAAAgB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAAnB,EA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+L,WAAY,EACjB/L,KAAKgM,MAAMrJ,OAAS,EACb3C,sCAYP,OAHAA,KAAK+L,WAAY,EACjB/L,KAAKoN,QAAQpN,KAAKgM,OAClBhM,KAAKgM,MAAMrJ,OAAS,EACb3C,oCAkBP,IAEIqN,EAFA3E,SACAX,SAGJ,OAAQsF,EAAMhK,UAAOV,QACrB,KAAK,EACD+F,0CACA,MAEJ,KAAK,EACDA,0CACAX,0CACA,MAEJ,QACI,OAAO/H,KAGX,OAAY,IAARqN,GACArN,KAAK+L,UAAY/L,KAAKgM,MAAMxL,MAAMkI,EAAMX,IAAQ/H,KAAKoN,UAAU1E,EAAMX,KAC9D/H,MAGJA,KAAK6L,OAAOyB,aAAa5E,mCAI3BC,GAAO,IAAA5C,EAAA/F,KAMZ,OAAqB,IAAjB2I,EAAMhG,OACC3C,MAGXA,KAAK6L,OAAOT,OAAOzC,EAAM3F,IAAI,SAAA0F,GAAA,OAAS3C,EAAK8F,OAAO0B,yBAAyB7E,EAAK,IAAKA,EAAK,OACnF1I,sCAQP,OAAOA,KAAK6L,2CASZ,OAAO7L,KAAK6L,OAAO/O,KAAK4G,sCA5SbhD,GACX,OAAO,IAAIiL,GAAQO,gBAAgB,KAAMxL,YC1BjD8M,EAAA","file":"hyperdis.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"hyperdis\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"hyperdis\"] = factory();\n\telse\n\t\troot[\"hyperdis\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","const makeEntry = (arr, sCon) => {\n arr.forEach((elem) => {\n if (elem === undefined || elem === null) {\n return;\n }\n sCon[elem] = 1;\n });\n};\n\nexport default class ForeignSet {\n constructor (arr) {\n this._set = {};\n makeEntry(arr, this._set);\n }\n\n append (arr) {\n makeEntry(arr, this._set);\n return this;\n }\n\n toArray () {\n return Object.keys(this._set);\n }\n\n static difference (set1, set2) {\n let key;\n const filteredKeys = [],\n s1 = set1._set,\n s2 = set2._set;\n for (key in s1) {\n if (!({}).hasOwnProperty.call(s1, key)) {\n continue;\n }\n if (key in s2) {\n continue;\n }\n filteredKeys.push(key);\n }\n return new ForeignSet(filteredKeys);\n }\n}\n","/* global window */\n\nimport ForeignSet from './set';\n\nconst\n isSimpleObject = (obj) => {\n let token;\n if (typeof obj === 'object') {\n if (obj === null) { return false; }\n token = Object.prototype.toString.call(obj);\n if (token === '[object Object]') {\n return (obj.constructor.toString().match(/^function (.*)\\(\\)/m) || [])[1] === 'Object';\n }\n }\n return false;\n },\n minMsThreshold = 16,\n /* istanbul ignore next */win = typeof window === 'undefined' ? (this || {}) : window,\n /* istanbul ignore next */ reqAnimFrame = win.requestAnimationFrame || win.webkitRequestAnimationFrame ||\n win.mozRequestAnimationFrame || win.oRequestAnimationFrame ||\n win.msRequestAnimationFrame ||\n function (callback) {\n setTimeout(callback, minMsThreshold);\n },\n\n getTimeBasedId = () => {\n if (getTimeBasedId.__lastTime === new Date().getTime()) {\n return (getTimeBasedId.__lastTime).toString() + (getTimeBasedId.__id++).toString();\n }\n\n getTimeBasedId.__id = 0;\n getTimeBasedId.__lastTime = new Date().getTime();\n return (getTimeBasedId.__lastTime).toString() + (getTimeBasedId.__id++).toString();\n },\n pullableRecent = (nodes, fn) => {\n let nFn = () => {\n fn(...nodes.map((node) => {\n const\n hist = node.history,\n l = hist.length - 1;\n return [hist[l - 1 < 0 ? 0 : l - 1], hist[l]];\n }));\n };\n nFn.__id = getTimeBasedId();\n return nFn;\n },\n pullableEnd = (nodes, fn) => {\n let nFn = () => {\n fn(...nodes.map((node) => {\n const hist = node.history;\n return [hist[0], hist[hist.length - 1]];\n }));\n };\n nFn.__id = getTimeBasedId();\n return nFn;\n },\n unique = fns => fns\n .reduce((store, fn) => {\n // @warn function with side effect, it mutates the store passed during initialization\n if (fn.__id in store.map) {\n return store;\n }\n\n store.map[fn.__id] = 1;\n store.unique.push(fn);\n\n return store;\n }, { map: {}, unique: [] })\n .unique,\n compose = fns => () => {\n fns.forEach(fn => fn());\n },\n flat = (params) => {\n const res = [];\n params.forEach(param => res.push(...param));\n return res;\n },\n identityMap = arrays => arrays,\n splitPathProp = (path) => {\n const pathArr = path.split('.'),\n len = pathArr.length;\n return [pathArr.slice(0, len - 1), pathArr[len - 1]];\n },\n scheduler = (onFinishCallback) => {\n let queue = [],\n animationFrame = null;\n\n onFinishCallback = onFinishCallback &&\n typeof onFinishCallback === 'function' && onFinishCallback || (() => { });\n\n return (listeners, payload) => {\n [].push.apply(queue, listeners);\n if (animationFrame === null) {\n animationFrame = reqAnimFrame(() => {\n const tempQ = queue.slice(0);\n queue.length = 0;\n animationFrame = null;\n\n unique(tempQ).forEach(fn => fn());\n onFinishCallback(payload);\n });\n }\n };\n },\n fetch = namedNode => (...params) => params.map((param) => {\n const node = namedNode[param];\n return {\n name: node.name,\n qualifiedName: node.qualifiedName,\n value: node.seed\n };\n }),\n fetchAggregator = (...params) => ({\n dependencies: params.slice(0, params.length - 1),\n fn: params[params.length - 1]\n }),\n getUpstreamNodes = (list) => {\n let res = [];\n const map = {};\n list.forEach(node => map[node.qualifiedName] = -1);\n function rec (arr) {\n arr.forEach((node) => {\n let qname,\n placedIndex,\n preArr,\n postArr;\n if (!((qname = node.qualifiedName) in map)) {\n map[qname] = res.push(node) - 1;\n } else {\n placedIndex = map[qname];\n if (placedIndex !== -1 && placedIndex !== res.length - 1) {\n // If not the last element, readjust the array so that the later dependency position is saved\n preArr = res.slice(0, placedIndex);\n postArr = res.slice(placedIndex + 1);\n res = preArr.concat(postArr);\n\n // reset the index in map\n postArr.forEach((elem, i) => map[elem.qualifiedName] = i + preArr.length);\n map[qname] = res.push(node) - 1;\n }\n }\n rec(node.outgoingEdges);\n });\n }\n rec(list);\n return res;\n },\n resolver = {\n accumulate: (...params) => {\n const resp = {};\n params.forEach((nodeDetails) => {\n Object.assign(resp, { [nodeDetails.name]: nodeDetails.value });\n });\n return resp;\n },\n identity: nodeDetails => nodeDetails.value\n };\n\nfunction resolveDependencyOrder (node, resolved, resolveMap) {\n let qname;\n node.edges.forEach((neighbour) => {\n resolveDependencyOrder(neighbour, resolved, resolveMap);\n });\n\n if (node.isRoot() || (qname = node.qualifiedName) in resolveMap) {\n return;\n }\n resolved.push(node);\n resolveMap[qname] = 1;\n}\n\nclass CustomResolver {\n constructor (resolver) {\n this.fn = resolver;\n this.dep = [];\n }\n\n addDependencies(...dep) {\n this.dep.push(...dep);\n return this;\n }\n\n getDependencies () {\n return this.dep;\n }\n\n get () {\n return this.fn;\n }\n}\n\nexport {\n isSimpleObject,\n scheduler,\n compose,\n flat,\n identityMap,\n pullableEnd,\n pullableRecent,\n unique,\n splitPathProp,\n resolver,\n ForeignSet,\n resolveDependencyOrder,\n fetch,\n fetchAggregator,\n CustomResolver,\n getUpstreamNodes\n};\n","export default class GraphNode {\n constructor (name, qualifiedName, options) {\n /* istanbul ignore next */options = options || {};\n this.name = name;\n this.qualifiedName = qualifiedName;\n this.edges = [];\n this.outgoingEdges = [];\n this._seed = null;\n this.requireResolve = true;\n this.retriever = options.retriever;\n this.history = [];\n this.resolver = null;\n this.electricEdges = [];\n }\n\n addDependencies (...dep) {\n this.edges.push(...dep);\n dep.forEach(entry => entry.outgoingEdges.push(this));\n return this;\n }\n\n addElectricNode (node) {\n this.electricEdges.push(node);\n return this;\n }\n\n get seed () {\n return this._seed;\n }\n\n set seed (value) {\n this._seed = value;\n this.requireResolve = true;\n return this;\n }\n\n resolve () {\n this.seed = this.resolver(...this.retrieveDetails());\n this.history.push(this.seed);\n this.requireResolve = false;\n return this;\n }\n\n retrieveDetails () {\n if (this.edges.length === 0) {\n return [{\n name: this.name,\n qualifiedName: this.qualifiedName,\n value: this.seed\n }];\n }\n return this.retriever(...this.edges.map(edge => edge.qualifiedName));\n }\n\n repeatHead () {\n const\n history = this.history,\n head = history[history.length - 1];\n // @todo- Akash, write test case if history.length === 0 to pass code coverage\n if (history.length === 0) {\n return this;\n }\n history.push(head);\n return this;\n }\n\n flush () {\n const hist = this.history,\n head = hist[hist.length - 1];\n hist.length = 0;\n hist.push(head);\n return this;\n }\n\n isRoot () {\n return this.name === null;\n }\n}\n","import {\n pullableRecent,\n pullableEnd\n} from './utils';\n\nexport default class ElectricNode {\n constructor () {\n this.edges = [];\n this.listeners = {\n nextFrame: [],\n currentFrame: []\n };\n }\n\n addEdges (...nodes) {\n this.edges.push(...nodes);\n return this;\n }\n\n regListenerForCurrFrame (fn) {\n const lstnrs = this.listeners.currentFrame;\n let index = lstnrs.push(pullableRecent(this.edges, fn)) - 1;\n\n return () => {\n this.listeners.currentFrame = lstnrs.filter((fn, i) => i !== index);\n };\n }\n\n regListenerForNextFrame (fn) {\n const lstnrs = this.listeners.nextFrame;\n let index = lstnrs.push(pullableEnd(this.edges, fn)) - 1;\n\n return () => {\n this.listeners.nextFrame = lstnrs.filter((fn, i) => i !== index);\n };\n }\n\n hasNextFrameListener () {\n return !!this.listeners.nextFrame.length;\n }\n}\n","import {\n isSimpleObject,\n resolver,\n // upstreamNodes,\n flat,\n resolveDependencyOrder,\n getUpstreamNodes,\n ForeignSet,\n fetch,\n CustomResolver,\n scheduler\n} from './utils';\nimport Node from './graph-node';\nimport ElectricNode from './electric-node';\n\nexport default class Graph {\n constructor () {\n this.qualifiedNodeMap = {};\n this.retriever = fetch(this.qualifiedNodeMap);\n this.root = new Node(null, null, { retriever: this.retriever });\n this.root.resolver = resolver.accumulate;\n\n this._wholeSet = null;\n this._propagate = true;\n this.propagationOverride = {\n currentFrameListeners: false,\n nextFrameListeners: false\n };\n\n this._schedule = scheduler((payload) => {\n let qname;\n for (qname in payload.flushTarget) {\n if (!({}).hasOwnProperty.call(this.qualifiedNodeMap, qname)) {\n return;\n }\n this.qualifiedNodeMap[qname].flush();\n }\n });\n }\n\n createNodesFrom (obj, mount) {\n let val,\n resolveReqList;\n const qualifiedNodeMap = this.qualifiedNodeMap,\n root = this.root,\n retriever = this.retriever;\n\n (function rec (objn, qualifiedName, history) {\n let key,\n qname,\n perv,\n node;\n\n for (key in objn) {\n if (!({}).hasOwnProperty.call(objn, key)) {\n continue;\n }\n qname = `${qualifiedName}${key}`;\n node = new Node(key, qname, { retriever });\n qualifiedNodeMap[qname] = node;\n\n if ((perv = history.perv) !== undefined) {\n perv.addDependencies(node);\n } else {\n // top most level entries\n root.addDependencies(node);\n }\n\n if (isSimpleObject(val = objn[key])) {\n rec(val, `${qualifiedName}${key}.`, { perv: node });\n node.resolver = resolver.accumulate;\n } else if (val instanceof CustomResolver) {\n node.resolver = val.get();\n node.addDependencies(...val.getDependencies().map(qname => qualifiedNodeMap[qname]));\n } else {\n node.resolver = resolver.identity;\n node.seed = val;\n // node.resolve();\n }\n }\n }(obj, mount === null ? '' : `${mount}.`, {\n perv: qualifiedNodeMap[mount]\n }));\n\n this._wholeSet = new ForeignSet(Object.keys(this.qualifiedNodeMap));\n\n // Recalculate the model without firing the listeners\n // @todo selective branch resolve. Currently resolve gets called even for a branch which was updated\n resolveReqList = this.constructor.getResolvedList(root).concat(root).filter(node => node.requireResolve);\n resolveReqList.forEach(node => node.resolve());\n getUpstreamNodes(resolveReqList).forEach(node => node.resolve());\n return this;\n }\n\n getNodeValue (prop) {\n if (prop in this.qualifiedNodeMap) {\n return this.qualifiedNodeMap[prop].seed;\n }\n return undefined;\n }\n\n createElectricNodeOf (props, fnSpec) {\n const nodes = props.map(prop => this.qualifiedNodeMap[prop]),\n eNode = new ElectricNode().addEdges(...nodes);\n\n nodes.forEach(node => node.addElectricNode(eNode));\n return eNode[`regListenerFor${fnSpec.type}`](fnSpec.fn);\n }\n\n update (params) {\n let changedSet,\n upstreamNodes;\n const\n electricEdges = [],\n nodes = params.map((entry) => {\n entry[0].seed = entry[1];\n return entry[0];\n });\n nodes.forEach(node => node.resolve());\n for (let val of flat(nodes.map(node => node.electricEdges))) {\n electricEdges.push(val);\n }\n changedSet = new ForeignSet(nodes.map(node => node.qualifiedName));\n\n if (!this._propagate) {\n this.__execUniqueElectricEdges(electricEdges);\n this._propagate = true;\n return this;\n }\n\n upstreamNodes = getUpstreamNodes(nodes);\n upstreamNodes.forEach(upstreamNode => upstreamNode.resolve());\n changedSet.append(upstreamNodes.map(node => node.qualifiedName));\n for (let val of flat(upstreamNodes.map(node => node.electricEdges))) {\n electricEdges.push(val);\n }\n\n this.__execUniqueElectricEdges(Array.from(new Set(electricEdges)), changedSet);\n return this;\n }\n\n __execUniqueElectricEdges (electricEdges, changedSet) {\n const\n cfLstnrs = [], // current frame listeners\n nfLstnrs = []; // next frame listeners\n if (changedSet) {\n const\n differenceSet = ForeignSet.difference(this._wholeSet, changedSet),\n entries = differenceSet.toArray();\n\n entries.forEach(entry => this.qualifiedNodeMap[entry].repeatHead());\n }\n\n electricEdges.forEach((e) => {\n cfLstnrs.push(...e.listeners.currentFrame);\n });\n electricEdges.forEach((e) => {\n nfLstnrs.push(...e.listeners.nextFrame);\n });\n\n !this.propagationOverride.currentFrameListeners && cfLstnrs.forEach(fn => fn());\n !this.propagationOverride.nextFrameListeners && this._schedule(nfLstnrs, { flushTarget: changedSet });\n this.resetPropagationOverride();\n return this;\n }\n\n resetNodeValue (...qnames) {\n const nodes = qnames.map(qname => this.qualifiedNodeMap[qname]),\n args = nodes.map(node => [node, node.seed]);\n this.update(args);\n return this;\n }\n\n static getResolvedList (node) {\n const resolved = [];\n resolveDependencyOrder(node, resolved, {});\n return resolved;\n }\n\n stopPropagation () {\n this._propagate = false;\n return this;\n }\n\n resetPropagationOverride () {\n this.propagationOverride.currentFrameListeners = false;\n this.propagationOverride.nextFrameListeners = false;\n return this;\n }\n\n setPropagationOverride (key) {\n this.propagationOverride[`${key}Listeners`] = true;\n return this;\n }\n\n getNodeFromQualifiedName (qname) {\n return this.qualifiedNodeMap[qname];\n }\n}\n","import Graph from './graph';\nimport { CustomResolver, fetchAggregator } from './utils';\n\n/**\n * The container class for Hyperdis. Hyperdis is an enabler for observable object with few interesting features like,\n * calculated property, next frame and same frame listeners, multiple listeners etc with a dependency resolving system.\n * It internally uses a graph to hold the hierarchial relationship of a object. Model is merely a container which\n * ties all the components together.\n *\n * @todo Circular dependency detection is not present\n *\n * @example check src/index.spec.js\n * @class\n */\nclass Model {\n constructor () {\n this._graph = new Graph();\n this._lockFlag = false;\n this._reqQ = [];\n }\n\n /**\n * Static method to create and init the model with an observable seed\n *\n * @param {Object} obj The target object which is required to be made observable\n * @return {Model} instance of the observable object model\n */\n static create (obj) {\n return new Model()._addPropInModel(null, obj);\n }\n\n /**\n * Appends more observable property on the already observable instance. This mutates the original model.\n *\n * This function works in two mode. One being\n * @param {String} mountPoint the property on which the new set of properties will be mounted. If its a nested\n * property then the mountPoint has to be written such a way so it feels like you are\n * accessing the object. If the mount point is not found then he obeservables are added in\n * the root.\n * @param {Object} The target object which is required to be made observable\n *\n * Another being\n * @param {Object} The target object which is required to be made observable\n *\n * @return {Model} instance of the observable object model\n */\n append (...params) {\n let mountPoint,\n obj;\n\n if (params.length === 1) {\n mountPoint = null;\n obj = params[0];\n } else {\n mountPoint = params[0];\n obj = params[1];\n }\n\n this._addPropInModel(mountPoint, obj);\n return this;\n }\n\n /**\n * Creates a calculated variable from existing variable. This variable can't be updated from outside.\n * @param {string} mountpoint property path on which the new variable will be placed\n * @param {string} name name of the variable. If the variable could have hierarchy like `limits.start`\n * @param {Function} fn funtion where the dependent variables are injected based on the dependency requirement\n */\n calculatedProp (...params) {\n let calculationConfig,\n customResolver,\n varName,\n mount,\n fetchFn;\n\n if (params.length > 2) {\n mount = params[0];\n varName = params[1];\n fetchFn = params[2];\n } else {\n mount = null;\n varName = params[0];\n fetchFn = params[1];\n }\n\n calculationConfig = fetchFn(fetchAggregator);\n customResolver = new CustomResolver(calculationConfig.fn);\n customResolver.addDependencies(...calculationConfig.dependencies);\n\n this._addPropInModel(mount, { [varName]: customResolver });\n return this;\n }\n\n // eslint-disable-next-line require-jsdoc\n _addPropInModel (mountPoint, obj) {\n this._graph.createNodesFrom(obj, mountPoint);\n return this;\n }\n\n /**\n * Register a listener in the current frame when a property or group of properties is changed.\n *\n * @example\n * This function takes a single or group of property and handler which is called when any of the properties are\n * changed.\n * When a single property is changed the handler is called with two parameter, what was the old value of the state\n * property and what is the new value.\n * myState.on('range.start', (oldValue, newValue) => {\n * console.log('Value before prop change', oldValue);\n * console.log('Value after prop change', newValue);\n * });\n *\n * myState.prop('range.start', 9);\n * // Output\n * Value before prop change 1\n * Value after prop change 9\n *\n * If a handler is registered on change of a property which has another state property as value, then the handler\n * gets called whenever any state property connected to it gets changed\n *\n * myState.on('range', (oldValue, newValue) => {\n * console.log('Value before prop change', oldValue);\n * console.log('Value after prop change', newValue);\n * });\n *\n * myState.prop('range.start', 10);\n * myState.prop('range.type.absolute', false);\n *\n * // Output\n * Value before prop change\n * range {\n * start: 9,\n * end: 5,\n * type: {\n * absolute: true\n * }\n * }\n * Value after prop change\n * range: {\n * start: 10,\n * end: 5,\n * type: {\n * absolute: false\n * }\n * }\n * If a handler is registered with more than one property change then, the handler is called when any of the\n * properties gets changed. In this cast the handler is called with more than one parameter: each for one state\n * property which is registered for listening. Each parameter is of type array containing [oldValue, newValue]\n *\n * myState.on('range.start', 'range.end', (start, end) => {\n * console.log('Start', start);\n * console.log('End', end);\n * });\n *\n * myState.prop('range.start', 12);\n *\n * // Output\n * Start [10, 12]\n * End [5, 5]\n *\n * myState.prop('range.end', 7);\n *\n * // Output\n * Start [12, 12]\n * End [5, 7]\n *\n * The on returns a function which is when called the listener registered gets unregistered\n *\n * let unsub = myState.on(['range.start', 'range.end'], (start, end) => {\n * console.log('Start', start);\n * console.log('End', end);\n * });\n *\n * // Unsubscribe\n * unsub()\n *\n * On takes an optional boolean value as the last parameter, which if passed as a true value the handler gets called\n * during registration itself.\n *\n * @param {Array.} props List of properties which is of interest\n * @param {Function} fn Listener to be executed when any of them is changed. The listener is called with the old\n * value and new value of the properties\n * @param {*} instantCall When registered if the function is to be triggered with the value of the property\n *\n * @return {Function} function to unsubscribe from the listeners registry\n */\n on (props, fn, instantCall) {\n const\n propsArr = props instanceof Array ? props : [props],\n // All there listeners will be executed in the current stack frame\n unsub = this._graph.createElectricNodeOf(propsArr, {\n type: 'CurrFrame',\n fn\n });\n\n if (instantCall) {\n // Bar current next frame listeners from getting fired\n this._graph.stopPropagation().setPropagationOverride('nextFrame').resetNodeValue(...props);\n }\n return unsub;\n }\n\n /**\n * Register a listener for the next frame when a property or group of properties is changed.\n *\n * @example\n * See the examples for the on listener\n *\n * @param {Array.} props List of properties which is of interest\n * @param {Function} fn Listener to be executed when any of them is changed. The listener is called with the old\n * value and new value of the properties. Here the oldvalue is last value of the last frame\n * @param {*} instantCall When registered if the function is to be triggered with the value of the property\n *\n * @return {Function} function to unsubscribe from the listeners registry\n */\n next (props, fn, instantCall) {\n const\n propsArr = props instanceof Array ? props : [props],\n // All there listeners will be executed at the tick of next animation frame\n unsub = this._graph.createElectricNodeOf(propsArr, {\n type: 'NextFrame',\n fn\n });\n\n // @todo check support for this from the graph side\n if (instantCall) {\n // Bar current frame listeners from getting fired\n this._graph.stopPropagation().setPropagationOverride('currentFrame').resetNodeValue(...props);\n }\n\n return unsub;\n }\n\n /**\n * Lock queues the request of property change and releases the change when unlock is called. This is helpful when\n * multiple property is getting called and the model listeners are to be fired once at the end of update.\n *\n * @return {Model} instance of the model\n */\n lock () {\n this._lockFlag = true;\n this._reqQ.length = 0;\n return this;\n }\n\n /**\n * Unlock unleashes the change done after the lock was called.\n\n * @return {Model} instance of the model\n */\n unlock () {\n this._lockFlag = false;\n this.setProp(this._reqQ);\n this._reqQ.length = 0;\n return this;\n }\n\n /**\n * This acts as getter and setter. If the function is called by passing only one argument, it retrieve the value\n * associated with the property. If the same function is called using two parameters, first one being the property\n * and second one being the value, then the value is set for the property and the handlers are called (if any)\n * which got registered using the on function\n *\n * Getter\n * @param {string} prop property path whose value to be retrieved\n * @return {Object} value of the property at the time of call\n *\n * Setter\n * @param {string} property property path whose value to be ser\n * @return {Model} instance of the model\n */\n prop (...params) {\n let prop,\n val,\n len;\n\n switch (len = params.length) {\n case 1:\n prop = params[0];\n break;\n\n case 2:\n prop = params[0];\n val = params[1];\n break;\n\n default:\n return this;\n }\n\n if (len === 2) {\n this._lockFlag ? this._reqQ.push([prop, val]) : this.setProp([[prop, val]]);\n return this;\n }\n\n return this._graph.getNodeValue(prop);\n }\n\n // eslint-disable-next-line require-jsdoc\n setProp (props) {\n // Filter out the calculated variables, so that it cant be changed from outside\n // @todo if a node is not leafValue, and change is called, ignore it too\n // props = props.filter(prop => !(VirtualObj.walkTill(prop[0].split('.'), this._vObj).leafValue()\n // instanceof CalculatedVar));\n\n if (props.length === 0) {\n return this;\n }\n\n this._graph.update(props.map(prop => [this._graph.getNodeFromQualifiedName(prop[0]), prop[1]]));\n return this;\n }\n\n /**\n * Retrieves the graph representation of the object\n * @return {Graph} instance of the graph associated to the model\n */\n graph () {\n return this._graph;\n }\n\n /**\n * Get serialized data from the model\n *\n * @return {Object} Serialized data\n */\n serialize () {\n return this._graph.root.seed;\n }\n}\n\nexport default Model;\n","import Model from './model';\n\nexport default Model;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3e86ff6..f24e2fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "hyperdis", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -505,6 +505,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -3918,7 +3919,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -3939,12 +3941,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3959,17 +3963,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -4086,7 +4093,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -4098,6 +4106,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4112,6 +4121,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4119,12 +4129,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -4143,6 +4155,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -4223,7 +4236,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -4235,6 +4249,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -4320,7 +4335,8 @@ "safe-buffer": { "version": "5.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -4356,6 +4372,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4375,6 +4392,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4418,12 +4436,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -6226,7 +6246,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "loose-envify": { "version": "1.4.0", diff --git a/package.json b/package.json index 8bec057..42bc51f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "hyperdis", "description": "A high performance reactive state store for web apps", "homepage": "https://github.com/chartshq/hyperdis", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "main": "dist/hyperdis.js", "author": "Charts.com ", @@ -59,4 +59,4 @@ "lint": "eslint ./src", "docs": "jsdoc -c ./jsdoc.conf.json" } -} +} \ No newline at end of file diff --git a/src/graph.js b/src/graph.js index cadff79..cf14135 100644 --- a/src/graph.js +++ b/src/graph.js @@ -107,7 +107,7 @@ export default class Graph { return eNode[`regListenerFor${fnSpec.type}`](fnSpec.fn); } - update (...params) { + update (params) { let changedSet, upstreamNodes; const @@ -117,7 +117,9 @@ export default class Graph { return entry[0]; }); nodes.forEach(node => node.resolve()); - electricEdges.push(...flat(...nodes.map(node => node.electricEdges))); + for (let val of flat(nodes.map(node => node.electricEdges))) { + electricEdges.push(val); + } changedSet = new ForeignSet(nodes.map(node => node.qualifiedName)); if (!this._propagate) { @@ -129,7 +131,9 @@ export default class Graph { upstreamNodes = getUpstreamNodes(nodes); upstreamNodes.forEach(upstreamNode => upstreamNode.resolve()); changedSet.append(upstreamNodes.map(node => node.qualifiedName)); - electricEdges.push(...flat(...upstreamNodes.map(node => node.electricEdges))); + for (let val of flat(upstreamNodes.map(node => node.electricEdges))) { + electricEdges.push(val); + } this.__execUniqueElectricEdges(Array.from(new Set(electricEdges)), changedSet); return this; @@ -163,7 +167,7 @@ export default class Graph { resetNodeValue (...qnames) { const nodes = qnames.map(qname => this.qualifiedNodeMap[qname]), args = nodes.map(node => [node, node.seed]); - this.update(...args); + this.update(args); return this; } diff --git a/src/model.js b/src/model.js index 020e4a7..f6dacfc 100644 --- a/src/model.js +++ b/src/model.js @@ -250,7 +250,7 @@ class Model { */ unlock () { this._lockFlag = false; - this.setProp(...this._reqQ); + this.setProp(this._reqQ); this._reqQ.length = 0; return this; } @@ -289,7 +289,7 @@ class Model { } if (len === 2) { - this._lockFlag ? this._reqQ.push([prop, val]) : this.setProp([prop, val]); + this._lockFlag ? this._reqQ.push([prop, val]) : this.setProp([[prop, val]]); return this; } @@ -297,7 +297,7 @@ class Model { } // eslint-disable-next-line require-jsdoc - setProp (...props) { + setProp (props) { // Filter out the calculated variables, so that it cant be changed from outside // @todo if a node is not leafValue, and change is called, ignore it too // props = props.filter(prop => !(VirtualObj.walkTill(prop[0].split('.'), this._vObj).leafValue() @@ -307,7 +307,7 @@ class Model { return this; } - this._graph.update(...props.map(prop => [this._graph.getNodeFromQualifiedName(prop[0]), prop[1]])); + this._graph.update(props.map(prop => [this._graph.getNodeFromQualifiedName(prop[0]), prop[1]])); return this; } diff --git a/src/utils/index.js b/src/utils/index.js index 8cf7335..0e42e35 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -70,7 +70,7 @@ const compose = fns => () => { fns.forEach(fn => fn()); }, - flat = (...params) => { + flat = (params) => { const res = []; params.forEach(param => res.push(...param)); return res;