wallace 0.1.0 → 0.3.0

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.
package/lib/component.js CHANGED
@@ -1,4 +1,4 @@
1
- const ALWAYS_UPDATE = "__";
1
+ const NO_LOOKUP = "__";
2
2
 
3
3
  /**
4
4
  * The base component.
@@ -22,7 +22,7 @@ var proto = Component.prototype;
22
22
  Object.defineProperty(proto, "hidden", {
23
23
  set: function (value) {
24
24
  this.el.hidden = value;
25
- },
25
+ }
26
26
  });
27
27
 
28
28
  proto._gs = function (name) {
@@ -52,12 +52,12 @@ proto._rq = function (props, key) {
52
52
  proto._ac = function (props, element, callbacks) {
53
53
  for (let key in callbacks) {
54
54
  let callback = callbacks[key];
55
- if (key === ALWAYS_UPDATE) {
55
+ if (key === NO_LOOKUP) {
56
56
  callback(element, props, this);
57
57
  } else {
58
58
  const result = this._rq(props, key);
59
59
  if (result[2]) {
60
- callback(result[0], result[1], element, props, this);
60
+ callback(element, props, this, result[0]);
61
61
  }
62
62
  }
63
63
  }
@@ -133,10 +133,7 @@ proto.update = function () {
133
133
  Object.keys(detachedElements).filter(function (k) {
134
134
  return k < index && detachedElements[k];
135
135
  }).length;
136
- parent.insertBefore(
137
- detachedElement,
138
- parent.childNodes[adjustedIndex]
139
- );
136
+ parent.insertBefore(detachedElement, parent.childNodes[adjustedIndex]);
140
137
  detachedElements[index] = null;
141
138
  } else if (!shouldBeVisible && !detachedElement) {
142
139
  thisElement = this._e[watch.e];
package/lib/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  onEvent,
11
11
  nestComponent,
12
12
  saveRef,
13
- stashMisc,
13
+ stashMisc
14
14
  } from "./initCalls";
15
15
 
16
16
  export {
@@ -27,5 +27,5 @@ export {
27
27
  saveRef,
28
28
  SequentialRepeater,
29
29
  stashMisc,
30
- watch,
30
+ watch
31
31
  };
package/lib/initCalls.js CHANGED
@@ -60,13 +60,7 @@ export function extendComponent(base, componentDef) {
60
60
  return _createConstructor(base);
61
61
  }
62
62
 
63
- export function defineComponent(
64
- html,
65
- watches,
66
- queries,
67
- buildFunction,
68
- inheritFrom
69
- ) {
63
+ export function defineComponent(html, watches, queries, buildFunction, inheritFrom) {
70
64
  const ComponentDefinition = _createConstructor(inheritFrom || Component);
71
65
  const prototype = ComponentDefinition.prototype;
72
66
  //Ensure these do not clash with fields on the component itself.
@@ -91,8 +85,8 @@ function _createConstructor(base) {
91
85
  constructor: {
92
86
  value: ComponentDefinition,
93
87
  writable: true,
94
- configurable: true,
95
- },
88
+ configurable: true
89
+ }
96
90
  });
97
91
  return ComponentDefinition;
98
92
  }