my-framework-almaz 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,6 @@
1
1
  function addEventListener$1(eventName, handler, el) {
2
- function boundHandler(event) {
3
- handler(event);
4
- }
5
- el.addEventListener(eventName, boundHandler);
6
- return boundHandler
2
+ el.addEventListener(eventName, handler);
3
+ return handler
7
4
  }
8
5
  function addEventListeners(listeners = {}, el) {
9
6
  const addedListeners = {};
@@ -182,14 +179,14 @@ function mapTextNodes(children) {
182
179
  typeof child === 'string' ? hString(child) : child
183
180
  )
184
181
  }
185
- function extraChildren(vdom) {
182
+ function extractChildren(vdom) {
186
183
  if (vdom.children == null) {
187
184
  return []
188
185
  }
189
186
  const children = [];
190
187
  for (const child of vdom.children) {
191
188
  if (child.type === DOM_TYPES.FRAGMENT) {
192
- children.push(...extraChildren(child));
189
+ children.push(...extractChildren(child));
193
190
  } else {
194
191
  children.push(child);
195
192
  }
@@ -513,8 +510,8 @@ function toClassList(classes = '') {
513
510
  : classes.split(/(\s+)/).filter(isNotBlankOrEmptyString)
514
511
  }
515
512
  function patchChildren(oldVdom, newVdom) {
516
- const oldChildren = extraChildren(oldVdom);
517
- const newChildren = extraChildren(newVdom);
513
+ const oldChildren = extractChildren(oldVdom);
514
+ const newChildren = extractChildren(newVdom);
518
515
  const parentEl = oldVdom.el;
519
516
  const diffSeq = arraysDiffSequence(
520
517
  oldChildren,
@@ -566,6 +563,7 @@ function createApp({ state, view, reducers = {} }) {
566
563
  }
567
564
  function renderApp() {
568
565
  const newVdom = view(state, emit);
566
+ console.log(newVdom);
569
567
  vdom = patchDOM(vdom, newVdom, parentEl);
570
568
  }
571
569
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-framework-almaz",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "A frontend framework to teach web developers how frontend frameworks work.",
5
5
  "keywords": [
6
6
  "frontend",