diff --git a/labeled-sliders/labeledSlider/view.js b/labeled-sliders/labeledSlider/view.js index 4f675d1c..15446428 100644 --- a/labeled-sliders/labeledSlider/view.js +++ b/labeled-sliders/labeledSlider/view.js @@ -1,9 +1,9 @@ import h from "snabbdom/h"; const { div, input, span } = require("hyperscript-helpers")(h); -const view = ({actions, measurement, index}) => { +const view = ({measurement, index}, actions) => { const getValue = evt => parseInt(evt.target.value, 10); - const onChangeValue = evt => actions.next({index, value: getValue(evt)}); + const onChangeValue = evt => actions.sendUpdate({index, value: getValue(evt)}); return ( div([ diff --git a/labeled-sliders/sliderContainer/main.js b/labeled-sliders/sliderContainer/main.js index 37bddc91..e02ff936 100644 --- a/labeled-sliders/sliderContainer/main.js +++ b/labeled-sliders/sliderContainer/main.js @@ -1,6 +1,5 @@ -import { assoc, merge } from "ramda"; -import { Action } from "./actions"; -import { initialModel, transform } from "./model"; +import { initialModel } from "./model"; +import receiveUpdate from "./receiveUpdate"; import view from "./view"; import createLabeledSlider from "../labeledSlider/main"; @@ -11,16 +10,7 @@ const createSliderContainer = createComponent => { return createComponent({ initialModel, view: view(LabeledSlider), - transform: transform(Action), - receivers: [(model, update) => { - if (parseInt(update.index, 10) >= 0) { - model.measurements[update.index] = assoc("value", update.value, model.measurements[update.index]); - } - else { - model = merge(model, update); - } - return model; - }] + receiveUpdate: receiveUpdate }); }; diff --git a/labeled-sliders/sliderContainer/model.js b/labeled-sliders/sliderContainer/model.js index 3322294d..11b0301b 100644 --- a/labeled-sliders/sliderContainer/model.js +++ b/labeled-sliders/sliderContainer/model.js @@ -1,30 +1,6 @@ -import { append, assoc } from "ramda"; - const initialModel = { measurements: [], nextId: 0 }; -const rnd = (min, max) => Math.round(Math.random() * min) + (max || 0); - -const transform = Action => (model, action) => Action.case({ - AddMeasurement: () => - assoc("nextId", - model.nextId + 1, - assoc("measurements", - append({ - id: model.nextId, - label: "Measurement", - value: rnd(50), - max: rnd(50,100), - units: rnd(10) % 2 === 0 ? "cm" : "mm" - }, model.measurements), - model - ) - ), - - RemoveMeasurement: id => - assoc("measurements", model.measurements.filter(m => m.id !== id), model) -}, action); - -export { initialModel, transform }; +export { initialModel }; diff --git a/labeled-sliders/sliderContainer/receiveUpdate.js b/labeled-sliders/sliderContainer/receiveUpdate.js new file mode 100644 index 00000000..61c06864 --- /dev/null +++ b/labeled-sliders/sliderContainer/receiveUpdate.js @@ -0,0 +1,36 @@ +import { append, assoc, merge } from "ramda"; +import { Action } from "./actions"; + +const rnd = (min, max) => Math.round(Math.random() * min) + (max || 0); + +const transform = (model, action) => Action.case({ + AddMeasurement: () => + assoc("nextId", + model.nextId + 1, + assoc("measurements", + append({ + id: model.nextId, + label: "Measurement", + value: rnd(50), + max: rnd(50,100), + units: rnd(10) % 2 === 0 ? "cm" : "mm" + }, model.measurements), + model + ) + ), + + RemoveMeasurement: id => + assoc("measurements", model.measurements.filter(m => m.id !== id), model) +}, action); + +const receiveUpdate = (model, update) => { + if (parseInt(update.index, 10) >= 0) { + model.measurements[update.index] = assoc("value", update.value, model.measurements[update.index]); + } + else { + model = merge(model, transform(model, update)); + } + return model; +}; + +export default receiveUpdate; diff --git a/labeled-sliders/sliderContainer/view.js b/labeled-sliders/sliderContainer/view.js index cf39915c..8cbb6941 100644 --- a/labeled-sliders/sliderContainer/view.js +++ b/labeled-sliders/sliderContainer/view.js @@ -3,13 +3,13 @@ const { div } = require("hyperscript-helpers")(h); import { Action } from "./actions"; -const view = LabeledSlider => ({model, actions}) => { - const onAddMeasurement = _evt => actions.next(Action.AddMeasurement()); - const onRemoveMeasurement = id => actions.next(Action.RemoveMeasurement(id)); +const view = LabeledSlider => (model, actions) => { + const onAddMeasurement = _evt => actions.sendUpdate(Action.AddMeasurement()); + const onRemoveMeasurement = id => actions.sendUpdate(Action.RemoveMeasurement(id)); - const renderMeasurement = (measurement, index) => + const renderMeasurement = (measurement, index) => div({key: measurement.id, style: {border: "1px solid gray"}, id: measurement.id}, [ - LabeledSlider({actions, measurement, index}), + LabeledSlider({measurement, index}, actions), div([ h("button.btn.btn-danger.btn-sm", {on: {click: [onRemoveMeasurement, measurement.id]}}, "Remove Measurement") diff --git a/todomvc/js/meiosis-tracer.min.js b/todomvc/js/meiosis-tracer.min.js index 41c7a496..e216a721 100644 --- a/todomvc/js/meiosis-tracer.min.js +++ b/todomvc/js/meiosis-tracer.min.js @@ -1,2 +1,2 @@ -var meiosisTracer=function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n=r(1);e.exports=n.meiosisTracer},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.meiosisTracer=void 0;var a=r(2),i=r(3),d=r(4),c=n(d),u=a.initialModel,o=function(e,t,r){e({receiveUpdate:(0,c["default"])(u,i.updateView)}),(0,i.initialView)(r,t,u)};t.meiosisTracer=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={tracerStates:[],tracerIndex:0};t.initialModel=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="tracerSlider",n="tracerIndex",a="tracerModel",i="tracerUpdate",d=function(e,t){var d=e.model,c=e.update,u=document.getElementById(r);u.setAttribute("max",String(t.tracerStates.length-1)),u.value=String(t.tracerIndex);var o=document.getElementById(n);o.innerHTML=String(t.tracerIndex);var s=document.getElementById(a);s.innerHTML=JSON.stringify(d);var l=document.getElementById(i);l.innerHTML=JSON.stringify(c)},c=function(e,t){return function(r){var n=parseInt(r.target.value,10),a=t.tracerStates[n];e(a.model),t.tracerIndex=n,d(a,t)}},u=function(e){return function(t){try{var r=JSON.parse(t.target.value);e(r)}catch(n){}}},o=function(e,t,d){var o=document.querySelector(e);if(o){var s="
"+String(d.tracerIndex)+"
";o.innerHTML=s,document.getElementById(r).addEventListener("input",c(t,d)),document.getElementById(a).addEventListener("keyup",u(t))}};t.initialView=o,t.updateView=d},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){return function(r,n){var a=JSON.parse(JSON.stringify(r)),i={model:a,update:n};return e.tracerStates.push(i),e.tracerIndex=e.tracerStates.length-1,t(i,e),r}};t["default"]=r}]); +var meiosisTracer=function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n=r(1);e.exports=n.meiosisTracer},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.meiosisTracer=void 0;var a=r(2),i=r(3),o=r(4),c=n(o),d=a.initialModel,l=function(e,t,r){e({receiveUpdate:(0,c["default"])(d,i.updateView)}),(0,i.initialView)(r,t,d)};t.meiosisTracer=l},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={tracerStates:[],tracerIndex:0};t.initialModel=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="tracerSlider",n="tracerIndex",a="tracerModel",i="tracerUpdate",o=function(e,t){var o=e.model,c=e.update,d=document.getElementById(r);d.setAttribute("max",String(t.tracerStates.length-1)),d.value=String(t.tracerIndex),console.log("updateView: index=",t.tracerIndex,"max=",t.tracerStates.length-1);var l=document.getElementById(n);l.innerHTML=String(t.tracerIndex);var s=document.getElementById(a);s.innerHTML=JSON.stringify(o);var u=document.getElementById(i);u.innerHTML=JSON.stringify(c),console.log("--updateView")},c=function(e,t){return function(r){var n=parseInt(r.target.value,10);console.log("onSliderChange:",n);var a=t.tracerStates[n];console.log("snapshot:",a.model),e(a.model),t.tracerIndex=n,o(a,t),console.log("--onSliderChange")}},d=function(e){return function(t){try{var r=JSON.parse(t.target.value);e(r)}catch(n){}}},l=function(e,t,o){var l=document.querySelector(e);if(l){var s="
"+String(o.tracerIndex)+"
";l.innerHTML=s,document.getElementById(r).addEventListener("input",c(t,o)),document.getElementById(a).addEventListener("keyup",d(t))}};t.initialView=l,t.updateView=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){return function(r,n){console.log("receiveUpdate:",r,n);var a=JSON.parse(JSON.stringify(r)),i={model:a,update:n};return e.tracerStates.push(i),e.tracerIndex=e.tracerStates.length-1,console.log("tracerIndex:",e.tracerIndex),console.log("--receiveUpdate"),t(i,e),r}};t["default"]=r}]); //# sourceMappingURL=meiosis-tracer.min.js.map \ No newline at end of file diff --git a/todomvc/js/meiosis-tracer.min.js.map b/todomvc/js/meiosis-tracer.min.js.map index a57f47e1..aaf2c1fe 100644 --- a/todomvc/js/meiosis-tracer.min.js.map +++ b/todomvc/js/meiosis-tracer.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///meiosis-tracer.min.js","webpack:///webpack/bootstrap 53480c366da433bac377","webpack:///./src/index.js","webpack:///./src/meiosis-tracer.js","webpack:///./src/model.js","webpack:///./src/view.js","webpack:///./src/receiveUpdate.js"],"names":["meiosisTracer","modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","_meiosisTracer","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","undefined","_model","_view","_receiveUpdate","_receiveUpdate2","tracerModel","initialModel","createComponent","renderRoot","selector","receiveUpdate","updateView","initialView","tracerStates","tracerIndex","tracerId","tracerIndexId","tracerModelId","tracerUpdateId","_ref","model","update","tracer","document","getElementById","setAttribute","String","length","innerHTML","tracerModelEl","JSON","stringify","tracerUpdateEl","onSliderChange","evt","index","parseInt","target","snapshot","onModelChange","parse","err","querySelector","viewHtml","addEventListener","view","modelCopy","modelAndUpdate","push"],"mappings":"AAAA,GAAIA,eACK,SAAUC,GCGnB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GA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AAYQ,aAAamC,KAAKD,GAC9B1C,EAAYS,YAAcT,EAAYQ,aAAac,OAAS,EAE5DkB,EAAKE,EAAgB1C,GAEde,GNuLRpC,cMpLc0B","file":"meiosis-tracer.min.js","sourcesContent":["var meiosisTracer =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \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/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tvar _meiosisTracer = __webpack_require__(1);\n\t\n\tmodule.exports = _meiosisTracer.meiosisTracer;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.meiosisTracer = undefined;\n\t\n\tvar _model = __webpack_require__(2);\n\t\n\tvar _view = __webpack_require__(3);\n\t\n\tvar _receiveUpdate = __webpack_require__(4);\n\t\n\tvar _receiveUpdate2 = _interopRequireDefault(_receiveUpdate);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar tracerModel = _model.initialModel;\n\t\n\tvar meiosisTracer = function meiosisTracer(createComponent, renderRoot, selector) {\n\t createComponent({\n\t receiveUpdate: (0, _receiveUpdate2.default)(tracerModel, _view.updateView)\n\t });\n\t (0, _view.initialView)(selector, renderRoot, tracerModel);\n\t};\n\t\n\texports.meiosisTracer = meiosisTracer;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar initialModel = {\n\t tracerStates: [],\n\t tracerIndex: 0\n\t};\n\t\n\texports.initialModel = initialModel;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar tracerId = \"tracerSlider\";\n\tvar tracerIndexId = \"tracerIndex\";\n\tvar tracerModelId = \"tracerModel\";\n\tvar tracerUpdateId = \"tracerUpdate\";\n\t\n\tvar updateView = function updateView(_ref, tracerModel) {\n\t var model = _ref.model;\n\t var update = _ref.update;\n\t\n\t var tracer = document.getElementById(tracerId);\n\t tracer.setAttribute(\"max\", String(tracerModel.tracerStates.length - 1));\n\t tracer.value = String(tracerModel.tracerIndex);\n\t\n\t var tracerIndex = document.getElementById(tracerIndexId);\n\t tracerIndex.innerHTML = String(tracerModel.tracerIndex);\n\t\n\t var tracerModelEl = document.getElementById(tracerModelId);\n\t tracerModelEl.innerHTML = JSON.stringify(model);\n\t\n\t var tracerUpdateEl = document.getElementById(tracerUpdateId);\n\t tracerUpdateEl.innerHTML = JSON.stringify(update);\n\t};\n\t\n\tvar onSliderChange = function onSliderChange(renderRoot, tracerModel) {\n\t return function (evt) {\n\t var index = parseInt(evt.target.value, 10);\n\t var snapshot = tracerModel.tracerStates[index];\n\t renderRoot(snapshot.model);\n\t tracerModel.tracerIndex = index;\n\t updateView(snapshot, tracerModel);\n\t };\n\t};\n\t\n\tvar onModelChange = function onModelChange(renderRoot) {\n\t return function (evt) {\n\t try {\n\t var model = JSON.parse(evt.target.value);\n\t renderRoot(model);\n\t } catch (err) {\n\t // ignore invalid JSON\n\t }\n\t };\n\t};\n\t\n\tvar initialView = function initialView(selector, renderRoot, tracerModel) {\n\t var target = document.querySelector(selector);\n\t\n\t if (target) {\n\t var viewHtml = \"
\" + \"
\" + String(tracerModel.tracerIndex) + \"
\" + \"\" + \"
\";\n\t\n\t target.innerHTML = viewHtml;\n\t document.getElementById(tracerId).addEventListener(\"input\", onSliderChange(renderRoot, tracerModel));\n\t document.getElementById(tracerModelId).addEventListener(\"keyup\", onModelChange(renderRoot));\n\t }\n\t};\n\t\n\texports.initialView = initialView;\n\texports.updateView = updateView;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar receiveUpdate = function receiveUpdate(tracerModel, view) {\n\t return function (model, update) {\n\t var modelCopy = JSON.parse(JSON.stringify(model));\n\t var modelAndUpdate = { model: modelCopy, update: update };\n\t tracerModel.tracerStates.push(modelAndUpdate);\n\t tracerModel.tracerIndex = tracerModel.tracerStates.length - 1;\n\t\n\t view(modelAndUpdate, tracerModel);\n\t\n\t return model;\n\t };\n\t};\n\t\n\texports.default = receiveUpdate;\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** meiosis-tracer.min.js\n **/"," \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\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 53480c366da433bac377\n **/","import { meiosisTracer } from \"./meiosis-tracer\";\n\nmodule.exports = meiosisTracer;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","import { initialModel } from \"./model\";\nimport { initialView, updateView } from \"./view\";\nimport receiveUpdate from \"./receiveUpdate\";\n\nconst tracerModel = initialModel;\n\nconst meiosisTracer = (createComponent, renderRoot, selector) => {\n createComponent({\n receiveUpdate: receiveUpdate(tracerModel, updateView)\n });\n initialView(selector, renderRoot, tracerModel);\n};\n\nexport { meiosisTracer };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/meiosis-tracer.js\n **/","const initialModel = {\n tracerStates: [],\n tracerIndex: 0\n};\n\nexport { initialModel };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/model.js\n **/","const tracerId = \"tracerSlider\";\nconst tracerIndexId = \"tracerIndex\";\nconst tracerModelId = \"tracerModel\";\nconst tracerUpdateId = \"tracerUpdate\";\n\nconst updateView = ({model, update}, tracerModel) => {\n const tracer = document.getElementById(tracerId);\n tracer.setAttribute(\"max\", String(tracerModel.tracerStates.length - 1));\n tracer.value = String(tracerModel.tracerIndex);\n\n const tracerIndex = document.getElementById(tracerIndexId);\n tracerIndex.innerHTML = String(tracerModel.tracerIndex);\n\n const tracerModelEl = document.getElementById(tracerModelId);\n tracerModelEl.innerHTML = JSON.stringify(model);\n\n const tracerUpdateEl = document.getElementById(tracerUpdateId);\n tracerUpdateEl.innerHTML = JSON.stringify(update);\n};\n\nconst onSliderChange = (renderRoot, tracerModel) => evt => {\n const index = parseInt(evt.target.value, 10);\n const snapshot = tracerModel.tracerStates[index];\n renderRoot(snapshot.model);\n tracerModel.tracerIndex = index;\n updateView(snapshot, tracerModel);\n};\n\nconst onModelChange = renderRoot => evt => {\n try {\n const model = JSON.parse(evt.target.value);\n renderRoot(model);\n }\n catch (err) {\n // ignore invalid JSON\n }\n};\n\nconst initialView = (selector, renderRoot, tracerModel) => {\n const target = document.querySelector(selector);\n\n if (target) {\n const viewHtml = \"
\" +\n \"
\" + String(tracerModel.tracerIndex) + \"
\" +\n \"\" +\n \"
\";\n\n target.innerHTML = viewHtml;\n document.getElementById(tracerId).addEventListener(\"input\", onSliderChange(renderRoot, tracerModel));\n document.getElementById(tracerModelId).addEventListener(\"keyup\", onModelChange(renderRoot));\n }\n};\n\nexport { initialView, updateView };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/view.js\n **/","const receiveUpdate = (tracerModel, view) => (model, update) => {\n const modelCopy = JSON.parse(JSON.stringify(model));\n const modelAndUpdate = { model: modelCopy, update };\n tracerModel.tracerStates.push(modelAndUpdate);\n tracerModel.tracerIndex = tracerModel.tracerStates.length - 1;\n\n view(modelAndUpdate, tracerModel);\n\n return model;\n};\n\nexport default receiveUpdate;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/receiveUpdate.js\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///meiosis-tracer.min.js","webpack:///webpack/bootstrap 34f4f2c1f01af719c33c","webpack:///./src/index.js","webpack:///./src/meiosis-tracer.js","webpack:///./src/model.js","webpack:///./src/view.js","webpack:///./src/receiveUpdate.js"],"names":["meiosisTracer","modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","_meiosisTracer","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","undefined","_model","_view","_receiveUpdate","_receiveUpdate2","tracerModel","initialModel","createComponent","renderRoot","selector","receiveUpdate","updateView","initialView","tracerStates","tracerIndex","tracerId","tracerIndexId","tracerModelId","tracerUpdateId","_ref","model","update","tracer","document","getElementById","setAttribute","String","length","console","log","innerHTML","tracerModelEl","JSON","stringify","tracerUpdateEl","onSliderChange","evt","index","parseInt","target","snapshot","onModelChange","parse","err","querySelector","viewHtml","addEventListener","view","modelCopy","modelAndUpdate","push"],"mappings":"AAAA,GAAIA,eACK,SAAUC,GCGnB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,GAGAV,EAAA,KDOM,SAASI,EAAQD,EAASH,GAE/B,YE/CD,IAAAW,GAAAX,EAAA,EAEAI,GAAOD,QAAPQ,EAAAb,eFqDM,SAASM,EAAQD,EAASH,GAE/B,YAeA,SAASY,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,UAASF,GAbvFG,OAAOC,eAAed,EAAS,cAC7Be,OAAO,IAETf,EAAQL,cAAgBqB,MG9DzB,IAAAC,GAAApB,EAAA,GACAqB,EAAArB,EAAA,GACAsB,EAAAtB,EAAA,GHoEKuB,EAAkBX,EAAuBU,GGlExCE,EAAAJ,EAAAK,aAEA3B,EAAgB,SAAC4B,EAAiBC,EAAYC,GAClDF,GACEG,eAAe,EAAAN,cAAcC,EAAdH,EAAAS,eAEjB,EAAAT,EAAAU,aAAYH,EAAUD,EAAYH,GHyEnCrB,GGtEQL,iBH0EH,SAASM,EAAQ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EAAYH,GACzC,GAAMkC,GAAShB,SAASqB,cAAcnC,EAEtC,IAAI8B,EAAQ,CACV,GAAMM,GAAW,mBAAqB9B,EAAW,+BAC/CW,OAAOrB,EAAYQ,aAAac,OAAS,GACzC,YAAcD,OAAOrB,EAAYS,aAAe,mCAClCE,EAAgB,KAAOU,OAAOrB,EAAYS,aAAe,uBACpDI,EAAiB,wEACjBD,EAAgB,+DAErCsB,GAAOT,UAAYe,EACnBtB,SAASC,eAAeT,GAAU+B,iBAAiB,QAASX,EAAe3B,EAAYH,IACvFkB,SAASC,eAAeP,GAAe6B,iBAAiB,QAASL,EAAcjC,KLmHlFxB,GK/GQ4B,cLgHR5B,EKhHqB2B,cLoHhB,SAAS1B,EAAQD,GAEtB,YAEAa,QAAOC,eAAed,EAAS,cAC7Be,OAAO,GMrLV,IAAMW,GAAgB,SAACL,EAAa0C,GAAd,MAAuB,UAAC3B,EAAOC,GACnDO,QAAQC,IAAI,iBAAkBT,EAAOC,EACrC,IAAM2B,GAAYhB,KAAKU,MAAMV,KAAKC,UAAUb,IACtC6B,GAAmB7B,MAAO4B,EAAW3B,SAQ3C,OAPAhB,GAAYQ,aAAaqC,KAAKD,GAC9B5C,EAAYS,YAAcT,EAAYQ,aAAac,OAAS,EAC5DC,QAAQC,IAAI,eAAgBxB,EAAYS,aACxCc,QAAQC,IAAI,mBAEZkB,EAAKE,EAAgB5C,GAEde,GN4LRpC,cMzLc0B","file":"meiosis-tracer.min.js","sourcesContent":["var meiosisTracer =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \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/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tvar _meiosisTracer = __webpack_require__(1);\n\t\n\tmodule.exports = _meiosisTracer.meiosisTracer;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.meiosisTracer = undefined;\n\t\n\tvar _model = __webpack_require__(2);\n\t\n\tvar _view = __webpack_require__(3);\n\t\n\tvar _receiveUpdate = __webpack_require__(4);\n\t\n\tvar _receiveUpdate2 = _interopRequireDefault(_receiveUpdate);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar tracerModel = _model.initialModel;\n\t\n\tvar meiosisTracer = function meiosisTracer(createComponent, renderRoot, selector) {\n\t createComponent({\n\t receiveUpdate: (0, _receiveUpdate2.default)(tracerModel, _view.updateView)\n\t });\n\t (0, _view.initialView)(selector, renderRoot, tracerModel);\n\t};\n\t\n\texports.meiosisTracer = meiosisTracer;\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar initialModel = {\n\t tracerStates: [],\n\t tracerIndex: 0\n\t};\n\t\n\texports.initialModel = initialModel;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar tracerId = \"tracerSlider\";\n\tvar tracerIndexId = \"tracerIndex\";\n\tvar tracerModelId = \"tracerModel\";\n\tvar tracerUpdateId = \"tracerUpdate\";\n\t\n\tvar updateView = function updateView(_ref, tracerModel) {\n\t var model = _ref.model;\n\t var update = _ref.update;\n\t\n\t var tracer = document.getElementById(tracerId);\n\t tracer.setAttribute(\"max\", String(tracerModel.tracerStates.length - 1));\n\t tracer.value = String(tracerModel.tracerIndex);\n\t console.log(\"updateView: index=\", tracerModel.tracerIndex, \"max=\", tracerModel.tracerStates.length - 1);\n\t\n\t var tracerIndex = document.getElementById(tracerIndexId);\n\t tracerIndex.innerHTML = String(tracerModel.tracerIndex);\n\t\n\t var tracerModelEl = document.getElementById(tracerModelId);\n\t tracerModelEl.innerHTML = JSON.stringify(model);\n\t\n\t var tracerUpdateEl = document.getElementById(tracerUpdateId);\n\t tracerUpdateEl.innerHTML = JSON.stringify(update);\n\t console.log(\"--updateView\");\n\t};\n\t\n\tvar onSliderChange = function onSliderChange(renderRoot, tracerModel) {\n\t return function (evt) {\n\t var index = parseInt(evt.target.value, 10);\n\t console.log(\"onSliderChange:\", index);\n\t var snapshot = tracerModel.tracerStates[index];\n\t console.log(\"snapshot:\", snapshot.model);\n\t renderRoot(snapshot.model);\n\t tracerModel.tracerIndex = index;\n\t updateView(snapshot, tracerModel);\n\t console.log(\"--onSliderChange\");\n\t };\n\t};\n\t\n\tvar onModelChange = function onModelChange(renderRoot) {\n\t return function (evt) {\n\t try {\n\t var model = JSON.parse(evt.target.value);\n\t renderRoot(model);\n\t } catch (err) {\n\t // ignore invalid JSON\n\t }\n\t };\n\t};\n\t\n\tvar initialView = function initialView(selector, renderRoot, tracerModel) {\n\t var target = document.querySelector(selector);\n\t\n\t if (target) {\n\t var viewHtml = \"
\" + \"
\" + String(tracerModel.tracerIndex) + \"
\" + \"\" + \"
\";\n\t\n\t target.innerHTML = viewHtml;\n\t document.getElementById(tracerId).addEventListener(\"input\", onSliderChange(renderRoot, tracerModel));\n\t document.getElementById(tracerModelId).addEventListener(\"keyup\", onModelChange(renderRoot));\n\t }\n\t};\n\t\n\texports.initialView = initialView;\n\texports.updateView = updateView;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\tvar receiveUpdate = function receiveUpdate(tracerModel, view) {\n\t return function (model, update) {\n\t console.log(\"receiveUpdate:\", model, update);\n\t var modelCopy = JSON.parse(JSON.stringify(model));\n\t var modelAndUpdate = { model: modelCopy, update: update };\n\t tracerModel.tracerStates.push(modelAndUpdate);\n\t tracerModel.tracerIndex = tracerModel.tracerStates.length - 1;\n\t console.log(\"tracerIndex:\", tracerModel.tracerIndex);\n\t console.log(\"--receiveUpdate\");\n\t\n\t view(modelAndUpdate, tracerModel);\n\t\n\t return model;\n\t };\n\t};\n\t\n\texports.default = receiveUpdate;\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** meiosis-tracer.min.js\n **/"," \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\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 34f4f2c1f01af719c33c\n **/","import { meiosisTracer } from \"./meiosis-tracer\";\n\nmodule.exports = meiosisTracer;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","import { initialModel } from \"./model\";\nimport { initialView, updateView } from \"./view\";\nimport receiveUpdate from \"./receiveUpdate\";\n\nconst tracerModel = initialModel;\n\nconst meiosisTracer = (createComponent, renderRoot, selector) => {\n createComponent({\n receiveUpdate: receiveUpdate(tracerModel, updateView)\n });\n initialView(selector, renderRoot, tracerModel);\n};\n\nexport { meiosisTracer };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/meiosis-tracer.js\n **/","const initialModel = {\n tracerStates: [],\n tracerIndex: 0\n};\n\nexport { initialModel };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/model.js\n **/","const tracerId = \"tracerSlider\";\nconst tracerIndexId = \"tracerIndex\";\nconst tracerModelId = \"tracerModel\";\nconst tracerUpdateId = \"tracerUpdate\";\n\nconst updateView = ({model, update}, tracerModel) => {\n const tracer = document.getElementById(tracerId);\n tracer.setAttribute(\"max\", String(tracerModel.tracerStates.length - 1));\n tracer.value = String(tracerModel.tracerIndex);\n console.log(\"updateView: index=\", tracerModel.tracerIndex, \"max=\", tracerModel.tracerStates.length - 1);\n\n const tracerIndex = document.getElementById(tracerIndexId);\n tracerIndex.innerHTML = String(tracerModel.tracerIndex);\n\n const tracerModelEl = document.getElementById(tracerModelId);\n tracerModelEl.innerHTML = JSON.stringify(model);\n\n const tracerUpdateEl = document.getElementById(tracerUpdateId);\n tracerUpdateEl.innerHTML = JSON.stringify(update);\n console.log(\"--updateView\");\n};\n\nconst onSliderChange = (renderRoot, tracerModel) => evt => {\n const index = parseInt(evt.target.value, 10);\n console.log(\"onSliderChange:\", index);\n const snapshot = tracerModel.tracerStates[index];\n console.log(\"snapshot:\", snapshot.model);\n renderRoot(snapshot.model);\n tracerModel.tracerIndex = index;\n updateView(snapshot, tracerModel);\n console.log(\"--onSliderChange\");\n};\n\nconst onModelChange = renderRoot => evt => {\n try {\n const model = JSON.parse(evt.target.value);\n renderRoot(model);\n }\n catch (err) {\n // ignore invalid JSON\n }\n};\n\nconst initialView = (selector, renderRoot, tracerModel) => {\n const target = document.querySelector(selector);\n\n if (target) {\n const viewHtml = \"
\" +\n \"
\" + String(tracerModel.tracerIndex) + \"
\" +\n \"\" +\n \"
\";\n\n target.innerHTML = viewHtml;\n document.getElementById(tracerId).addEventListener(\"input\", onSliderChange(renderRoot, tracerModel));\n document.getElementById(tracerModelId).addEventListener(\"keyup\", onModelChange(renderRoot));\n }\n};\n\nexport { initialView, updateView };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/view.js\n **/","const receiveUpdate = (tracerModel, view) => (model, update) => {\n console.log(\"receiveUpdate:\", model, update);\n const modelCopy = JSON.parse(JSON.stringify(model));\n const modelAndUpdate = { model: modelCopy, update };\n tracerModel.tracerStates.push(modelAndUpdate);\n tracerModel.tracerIndex = tracerModel.tracerStates.length - 1;\n console.log(\"tracerIndex:\", tracerModel.tracerIndex);\n console.log(\"--receiveUpdate\");\n\n view(modelAndUpdate, tracerModel);\n\n return model;\n};\n\nexport default receiveUpdate;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/receiveUpdate.js\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/todomvc/js/meiosis.min.js b/todomvc/js/meiosis.min.js index 7954d082..fa4b76d2 100644 --- a/todomvc/js/meiosis.min.js +++ b/todomvc/js/meiosis.min.js @@ -1,2 +1,2 @@ -var meiosis=function(e){function r(t){if(n[t])return n[t].exports;var i=n[t]={exports:{},id:t,loaded:!1};return e[t].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}var n={};return r.m=e,r.c=n,r.p="",r(0)}([function(e,r,n){"use strict";var t=n(1);e.exports=t.meiosis},function(e,r,n){"use strict";var t=n(2),i=n(3),o=function(e){var r=[],n=[],o=[],u=e.wire||i.defaultWire,a=u("meiosis"),c=e.merge||t.defaultMerge,f={},s=function(e){if(!(e&&(e.actions||e.nextUpdate||e.initialModel||e.ready||e.receiveUpdate||e.view)))throw new Error("Please specify a config when calling createComponent.");var t=e.initialModel||{};f=c(f,t);var i=u(),s=i.emit,l={sendUpdate:s},v=e.actions?c(l,e.actions(s)):l,d=e.receiveUpdate;d&&r.push(d);var p=e.ready;p&&n.push(function(){return p(v)});var h=e.postRender;return h&&o.push(h),i.listen(function(n){r.forEach(function(e){return f=e(f,n)}),a.emit(f),e.nextUpdate&&e.nextUpdate(f,n,v)}),function(r){return e.view(r,v)}},l=function(t){0===r.length&&r.push(c);var i=function(r){var n=t(r);e.render(n),o.forEach(function(e){return e(n)})};return a.listen(i),a.emit(f),n.forEach(function(e){return e()}),i};return{createComponent:s,run:l}};r.meiosis=o},function(e,r){"use strict";var n=function(e){for(var r=[],n=1;n {\n let allReceiveUpdates: Array = [];\n let allReadies: Array = [];\n let allPostRenders: Array = [];\n\n const wire: WireCreator = adapters.wire || defaultWire;\n const rootWire = wire(\"meiosis\");\n\n const merge: Merger = adapters.merge || defaultMerge;\n\n let rootModel: any = {};\n\n const createComponent = (config: Config) => {\n if (!config || (\n !config.actions &&\n !config.nextUpdate &&\n !config.initialModel &&\n !config.ready &&\n !config.receiveUpdate &&\n !config.view\n )) {\n throw new Error(\"Please specify a config when calling createComponent.\");\n }\n const initialModel: any = config.initialModel || {};\n rootModel = merge(rootModel, initialModel);\n\n const componentWire: Wire = wire();\n const sendUpdate: Emitter = componentWire.emit;\n const sendUpdateActions = {sendUpdate};\n const actions = config.actions ? merge(sendUpdateActions, config.actions(sendUpdate)) : sendUpdateActions;\n\n const receiveUpdate: ReceiveUpdate = config.receiveUpdate;\n if (receiveUpdate) {\n allReceiveUpdates.push(receiveUpdate);\n }\n\n const ready: Ready = config.ready;\n if (ready) {\n allReadies.push(() => ready(actions));\n }\n\n const postRender: PostRender = config.postRender;\n if (postRender) {\n allPostRenders.push(postRender);\n }\n\n componentWire.listen((update: any) => {\n allReceiveUpdates.forEach((receiveUpdate: ReceiveUpdate) => {\n rootModel = receiveUpdate(rootModel, update);\n return rootModel;\n });\n\n rootWire.emit(rootModel);\n\n if (config.nextUpdate) {\n config.nextUpdate(rootModel, update, actions);\n }\n });\n\n return (model: any) => config.view(model, actions);\n };\n\n const run = (root: Component) => {\n if (allReceiveUpdates.length === 0) {\n allReceiveUpdates.push(merge);\n }\n const renderRoot = (model: any) => {\n const rootView = root(model);\n adapters.render(rootView);\n allPostRenders.forEach((postRender: PostRender) => postRender(rootView));\n };\n rootWire.listen(renderRoot);\n\n rootWire.emit(rootModel);\n allReadies.forEach((ready: Function) => ready());\n\n return renderRoot;\n };\n\n return { createComponent, run };\n};\n\nexport { meiosis };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/meiosis.ts\n **/","interface Merger {\n (target: any, ...sources: Array): any;\n}\n\nconst defaultMerge: Merger = function(target: any, ...sources: Array) {\n if (target === undefined || target === null) {\n throw new TypeError(\"Cannot convert undefined or null to object\");\n }\n\n let output = Object(target);\n for (let index = 1; index < arguments.length; index++) {\n const source = arguments[index];\n if (source !== undefined && source !== null) {\n for (let nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n return output;\n};\n\nexport { Merger, defaultMerge };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/merge.ts\n **/","interface Listener {\n (data: any): any;\n}\n\ninterface Emitter {\n (data: any): any;\n}\n\ninterface Wire {\n emit: Emitter;\n listen(listener: Listener): any;\n}\n\ninterface WireCreator {\n (wireName?: string): Wire;\n}\n\nconst defaultWire: WireCreator = (function() {\n let wires = {};\n let nextWireId = 1;\n\n const createWire = function(): Wire {\n let listener: Listener = null;\n const listen = (lstnr: Listener) => listener = lstnr;\n const emit = (data: any) => listener(data);\n\n return { emit, listen };\n };\n\n return function(wireName: string) {\n let name = wireName;\n if (!name) {\n name = \"wire_\" + nextWireId;\n nextWireId++;\n }\n let theWire: Wire = wires[name];\n if (!theWire) {\n theWire = createWire();\n wires[name] = theWire;\n }\n return theWire;\n };\n})();\n\nexport { Emitter, Listener, Wire, WireCreator, defaultWire };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/wire.ts\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///meiosis.min.js","webpack:///webpack/bootstrap 9d607f7b6c554429cb15","webpack:///./src/index.ts","webpack:///./src/meiosis.ts","webpack:///./src/merge.ts","webpack:///./src/wire.ts"],"names":["meiosis","modules","__webpack_require__","moduleId","installedModules","exports","module","id","loaded","call","m","c","p","meiosis_1","merge_1","wire_1","adapters","allReceiveUpdates","allReadies","allPostRenders","wire","defaultWire","rootWire","merge","defaultMerge","rootModel","createComponent","config","actions","nextUpdate","initialModel","ready","receiveUpdate","view","Error","componentWire","sendUpdate","emit","sendUpdateActions","push","postRender","listen","update","forEach","model","run","root","length","renderRoot","rootView","render","meiosisInstance","target","sources","_i","arguments","undefined","TypeError","output","Object","index","source","nextKey","hasOwnProperty","wires","nextWireId","createWire","listener","lstnr","data","wireName","name","theWire"],"mappings":"AAAA,GAAIA,SACK,SAAUC,GCGnB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAE,WACAE,GAAAJ,EACAK,QAAA,EAUA,OANAP,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,QAAA,EAGAF,EAAAD,QAvBA,GAAAD,KAqCA,OATAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,GAGAV,EAAA,KDOM,SAASI,EAA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,QAAQ,SAACH,GAA2B,MAAAA,GAAWS,KAOhE,OALA3B,GAASmB,OAAOO,GAEhB1B,EAASe,KAAKZ,GACdP,EAAWyB,QAAQ,SAACZ,GAAoB,MAAAA,OAEjCiB,GAGHG,GAAqCzB,kBAAiBmB,MAE5D,OAAOM,GAGA9C,GAAAL,QAAOA,GHcV,SAASM,EAAQD,GAEtB,YI9HD,IAAMmB,GAAuB,SAAS4B,GJiIjC,IIjI8C,GAAAC,MAAAC,EAAA,EAAAA,EAAAC,UAAAR,OAAAO,IAAAD,EAAAC,EAAA,GAAAC,UAAAD,EACjD,IAAeE,SAAXJ,GAAmC,OAAXA,EAC1B,KAAM,IAAIK,WAAU,6CAItB,KAAK,GADDC,GAASC,OAAOP,GACXQ,EAAQ,EAAGA,EAAQL,UAAUR,OAAQa,IAAS,CACrD,GAAMC,GAASN,UAAUK,EACzB,IAAeJ,SAAXK,GAAmC,OAAXA,EAC1B,IAAK,GAAIC,KAAWD,GACdA,EAAOE,eAAeD,KACxBJ,EAAOI,GAAWD,EAAOC,IAKjC,MAAOJ,GAGQrD,GAAAmB,aAAYA,GJsIvB,SAASlB,EAAQD,GAEtB,YK9ID,IAAMgB,GAA2B,WAC/B,GAAI2C,MACAC,EAAa,EAEXC,EAAa,WACjB,GAAIC,GAAqB,KACnB1B,EAAS,SAAC2B,GAAoB,MAAAD,GAAWC,GACzC/B,EAAO,SAACgC,GAAc,MAAAF,GAASE,GAErC,QAAShC,OAAMI,UAGjB,OAAO,UAAS6B,GACd,GAAIC,GAAOD,CACNC,KACHA,EAAO,QAAUN,EACjBA,IAEF,IAAIO,GAAgBR,EAAMO,EAK1B,OAJKC,KACHA,EAAUN,IACVF,EAAMO,GAAQC,GAETA,KAIoCnE,GAAAgB,YAAWA","file":"meiosis.min.js","sourcesContent":["var meiosis =\n/******/ (function(modules) { // webpackBootstrap\n/******/ \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/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar meiosis_1 = __webpack_require__(1);\n\tmodule.exports = meiosis_1.meiosis;\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\tvar merge_1 = __webpack_require__(2);\n\tvar wire_1 = __webpack_require__(3);\n\tvar meiosis = function (adapters) {\n\t var allReceiveUpdates = [];\n\t var allReadies = [];\n\t var allPostRenders = [];\n\t var wire = adapters.wire || wire_1.defaultWire;\n\t var rootWire = wire(\"meiosis\");\n\t var merge = adapters.merge || merge_1.defaultMerge;\n\t var rootModel = {};\n\t var createComponent = function (config) {\n\t if (!config || (!config.actions &&\n\t !config.nextUpdate &&\n\t !config.initialModel &&\n\t !config.ready &&\n\t !config.receiveUpdate &&\n\t !config.view)) {\n\t throw new Error(\"Please specify a config when calling createComponent.\");\n\t }\n\t var initialModel = config.initialModel || {};\n\t rootModel = merge(rootModel, initialModel);\n\t var componentWire = wire();\n\t var sendUpdate = componentWire.emit;\n\t var sendUpdateActions = { sendUpdate: sendUpdate };\n\t var actions = config.actions ? merge(sendUpdateActions, config.actions(sendUpdate)) : sendUpdateActions;\n\t var receiveUpdate = config.receiveUpdate;\n\t if (receiveUpdate) {\n\t allReceiveUpdates.push(receiveUpdate);\n\t }\n\t var ready = config.ready;\n\t if (ready) {\n\t allReadies.push(function () { return ready(actions); });\n\t }\n\t var postRender = config.postRender;\n\t if (postRender) {\n\t allPostRenders.push(postRender);\n\t }\n\t componentWire.listen(function (update) {\n\t allReceiveUpdates.forEach(function (receiveUpdate) {\n\t rootModel = receiveUpdate(rootModel, update);\n\t return rootModel;\n\t });\n\t rootWire.emit(rootModel);\n\t if (config.nextUpdate) {\n\t config.nextUpdate(rootModel, update, actions);\n\t }\n\t });\n\t return function (model) { return config.view(model, actions); };\n\t };\n\t var run = function (root) {\n\t if (allReceiveUpdates.length === 0) {\n\t allReceiveUpdates.push(merge);\n\t }\n\t var renderRoot = function (model) {\n\t var rootView = root(model);\n\t adapters.render(rootView);\n\t allPostRenders.forEach(function (postRender) { return postRender(rootView); });\n\t };\n\t rootWire.listen(renderRoot);\n\t rootWire.emit(rootModel);\n\t allReadies.forEach(function (ready) { return ready(); });\n\t return renderRoot;\n\t };\n\t var meiosisInstance = { createComponent: createComponent, run: run };\n\t return meiosisInstance;\n\t};\n\texports.meiosis = meiosis;\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar defaultMerge = function (target) {\n\t var sources = [];\n\t for (var _i = 1; _i < arguments.length; _i++) {\n\t sources[_i - 1] = arguments[_i];\n\t }\n\t if (target === undefined || target === null) {\n\t throw new TypeError(\"Cannot convert undefined or null to object\");\n\t }\n\t var output = Object(target);\n\t for (var index = 1; index < arguments.length; index++) {\n\t var source = arguments[index];\n\t if (source !== undefined && source !== null) {\n\t for (var nextKey in source) {\n\t if (source.hasOwnProperty(nextKey)) {\n\t output[nextKey] = source[nextKey];\n\t }\n\t }\n\t }\n\t }\n\t return output;\n\t};\n\texports.defaultMerge = defaultMerge;\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\tvar defaultWire = (function () {\n\t var wires = {};\n\t var nextWireId = 1;\n\t var createWire = function () {\n\t var listener = null;\n\t var listen = function (lstnr) { return listener = lstnr; };\n\t var emit = function (data) { return listener(data); };\n\t return { emit: emit, listen: listen };\n\t };\n\t return function (wireName) {\n\t var name = wireName;\n\t if (!name) {\n\t name = \"wire_\" + nextWireId;\n\t nextWireId++;\n\t }\n\t var theWire = wires[name];\n\t if (!theWire) {\n\t theWire = createWire();\n\t wires[name] = theWire;\n\t }\n\t return theWire;\n\t };\n\t})();\n\texports.defaultWire = defaultWire;\n\n\n/***/ }\n/******/ ]);\n\n\n/** WEBPACK FOOTER **\n ** meiosis.min.js\n **/"," \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\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 9d607f7b6c554429cb15\n **/","import { meiosis } from \"./meiosis\";\n\nexport = meiosis;\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.ts\n **/","import { Adapters } from \"./adapters\";\nimport { Config } from \"./config\";\nimport { Merger, defaultMerge } from \"./merge\";\nimport { NextUpdate } from \"./nextUpdate\";\nimport { PostRender } from \"./postRender\";\nimport { Ready } from \"./ready\";\nimport { ReceiveUpdate } from \"./receiveUpdate\";\nimport { Emitter, Listener, WireCreator, Wire, defaultWire } from \"./wire\";\n\ninterface Component {\n (model: any): any;\n}\n\ninterface CreateComponent {\n (config: Config): Component;\n}\n\ninterface Run {\n (model: any): any;\n}\n\ninterface MeiosisInstance {\n createComponent: CreateComponent;\n run: Run;\n}\n\ninterface Meiosis {\n (adapters: Adapters): MeiosisInstance;\n}\n\nconst meiosis: Meiosis = (adapters: Adapters) => {\n let allReceiveUpdates: Array = [];\n let allReadies: Array = [];\n let allPostRenders: Array = [];\n\n const wire: WireCreator = adapters.wire || defaultWire;\n const rootWire = wire(\"meiosis\");\n\n const merge: Merger = adapters.merge || defaultMerge;\n\n let rootModel: any = {};\n\n const createComponent: CreateComponent = (config: Config) => {\n if (!config || (\n !config.actions &&\n !config.nextUpdate &&\n !config.initialModel &&\n !config.ready &&\n !config.receiveUpdate &&\n !config.view\n )) {\n throw new Error(\"Please specify a config when calling createComponent.\");\n }\n const initialModel: any = config.initialModel || {};\n rootModel = merge(rootModel, initialModel);\n\n const componentWire: Wire = wire();\n const sendUpdate: Emitter = componentWire.emit;\n const sendUpdateActions = {sendUpdate};\n const actions = config.actions ? merge(sendUpdateActions, config.actions(sendUpdate)) : sendUpdateActions;\n\n const receiveUpdate: ReceiveUpdate = config.receiveUpdate;\n if (receiveUpdate) {\n allReceiveUpdates.push(receiveUpdate);\n }\n\n const ready: Ready = config.ready;\n if (ready) {\n allReadies.push(() => ready(actions));\n }\n\n const postRender: PostRender = config.postRender;\n if (postRender) {\n allPostRenders.push(postRender);\n }\n\n componentWire.listen((update: any) => {\n allReceiveUpdates.forEach((receiveUpdate: ReceiveUpdate) => {\n rootModel = receiveUpdate(rootModel, update);\n return rootModel;\n });\n\n rootWire.emit(rootModel);\n\n if (config.nextUpdate) {\n config.nextUpdate(rootModel, update, actions);\n }\n });\n\n return (model: any) => config.view(model, actions);\n };\n\n const run = (root: Component) => {\n if (allReceiveUpdates.length === 0) {\n allReceiveUpdates.push(merge);\n }\n const renderRoot = (model: any) => {\n const rootView = root(model);\n adapters.render(rootView);\n allPostRenders.forEach((postRender: PostRender) => postRender(rootView));\n };\n rootWire.listen(renderRoot);\n\n rootWire.emit(rootModel);\n allReadies.forEach((ready: Function) => ready());\n\n return renderRoot;\n };\n\n const meiosisInstance: MeiosisInstance = { createComponent, run };\n\n return meiosisInstance;\n};\n\nexport { meiosis };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/meiosis.ts\n **/","interface Merger {\n (target: any, ...sources: Array): any;\n}\n\nconst defaultMerge: Merger = function(target: any, ...sources: Array) {\n if (target === undefined || target === null) {\n throw new TypeError(\"Cannot convert undefined or null to object\");\n }\n\n let output = Object(target);\n for (let index = 1; index < arguments.length; index++) {\n const source = arguments[index];\n if (source !== undefined && source !== null) {\n for (let nextKey in source) {\n if (source.hasOwnProperty(nextKey)) {\n output[nextKey] = source[nextKey];\n }\n }\n }\n }\n return output;\n};\n\nexport { Merger, defaultMerge };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/merge.ts\n **/","interface Listener {\n (data: any): any;\n}\n\ninterface Emitter {\n (data: any): any;\n}\n\ninterface Wire {\n emit: Emitter;\n listen(listener: Listener): any;\n}\n\ninterface WireCreator {\n (wireName?: string): Wire;\n}\n\nconst defaultWire: WireCreator = (function() {\n let wires = {};\n let nextWireId = 1;\n\n const createWire = function(): Wire {\n let listener: Listener = null;\n const listen = (lstnr: Listener) => listener = lstnr;\n const emit = (data: any) => listener(data);\n\n return { emit, listen };\n };\n\n return function(wireName: string) {\n let name = wireName;\n if (!name) {\n name = \"wire_\" + nextWireId;\n nextWireId++;\n }\n let theWire: Wire = wires[name];\n if (!theWire) {\n theWire = createWire();\n wires[name] = theWire;\n }\n return theWire;\n };\n})();\n\nexport { Emitter, Listener, Wire, WireCreator, defaultWire };\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/wire.ts\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/todomvc/vanillajs/ready.js b/todomvc/vanillajs/ready.js index 787fbb0d..91e1851c 100644 --- a/todomvc/vanillajs/ready.js +++ b/todomvc/vanillajs/ready.js @@ -33,6 +33,7 @@ } }); +//FIXME meiosisVanillaJs.delegate(root, "input.edit", "blur", function(evt) { var todoId = parseInt(evt.target.dataset.id, 10); actions.saveTodo(evt.target.value, todoId);