Skip to content

Commit

Permalink
Using external hyperhtml-wire module
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Giammarchi committed Jan 10, 2019
1 parent b11094d commit fd247c8
Show file tree
Hide file tree
Showing 25 changed files with 221 additions and 694 deletions.
2 changes: 1 addition & 1 deletion cjs/classes/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function setup(content) {
event.component = this;
return (_wire$.dispatchEvent ?
_wire$ :
_wire$.childNodes[0]
_wire$.n[0]
).dispatchEvent(event);
}
return false;
Expand Down
38 changes: 0 additions & 38 deletions cjs/classes/Wire.js

This file was deleted.

9 changes: 5 additions & 4 deletions cjs/hyper/wire.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';
const WeakMap = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('@ungap/weakmap'));

const Wire = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('../classes/Wire.js'));
const Wire = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('hyperhtml-wire'));

const {Tagger} = require('../objects/Updates.js');
const {reArguments, slice} = require('../shared/utils.js');
const {reArguments} = require('../shared/utils.js');

// all wires used per each context
const wires = new WeakMap;
Expand Down Expand Up @@ -73,9 +73,10 @@ const weakly = (obj, type) => {
// array of nodes or to this single referenced node.
const wireContent = node => {
const childNodes = node.childNodes;
return childNodes.length === 1 ?
const {length} = childNodes;
return length === 1 ?
childNodes[0] :
new Wire(slice.call(childNodes, 0));
(length ? new Wire(childNodes) : node);
};

exports.content = content;
Expand Down
1 change: 0 additions & 1 deletion cjs/objects/Basic.js

This file was deleted.

46 changes: 0 additions & 46 deletions cjs/objects/Engine.js

This file was deleted.

58 changes: 0 additions & 58 deletions cjs/objects/Path.js

This file was deleted.

82 changes: 0 additions & 82 deletions cjs/objects/Style.js

This file was deleted.

4 changes: 2 additions & 2 deletions cjs/objects/Updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const {
} = require('../shared/constants.js');

const Component = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('../classes/Component.js'));
const Wire = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('../classes/Wire.js'));
const Wire = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('hyperhtml-wire'));
const Intent = (m => m.__esModule ? /* istanbul ignore next */ m.default : /* istanbul ignore next */ m)(require('./Intent.js'));
const { slice, text } = require('../shared/utils.js');

Expand All @@ -36,7 +36,7 @@ const asNode = (item, i) => {
// all these cases are handled by domdiff already
/* istanbul ignore next */
((1 / i) < 0 ?
(i ? item.remove() : item.last) :
(i ? item.remove(true) : item.last) :
(i ? item.valueOf(true) : item.first)) :
asNode(item.render(), i));
}
Expand Down
79 changes: 0 additions & 79 deletions cjs/objects/hyperstyle.js

This file was deleted.

8 changes: 0 additions & 8 deletions cjs/shared/easy-dom.js

This file was deleted.

6 changes: 0 additions & 6 deletions cjs/shared/features-detection.js

This file was deleted.

Loading

0 comments on commit fd247c8

Please sign in to comment.