Skip to content

Commit 5182fe8

Browse files
Merge pull request #49 from nimiq/master
Add ES6 module build
2 parents 79bf4b7 + 5abe6e2 commit 5182fe8

File tree

5 files changed

+1539
-1462
lines changed

5 files changed

+1539
-1462
lines changed

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
bundle.js
1+
bundle.js
2+
bundle.es.js

bundle.es.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
2+
3+
var index = {
4+
props: {
5+
mapDispatchToProps: {
6+
required: false,
7+
default: () => ({}),
8+
type: Function
9+
},
10+
11+
mapStateToProps: {
12+
required: false,
13+
default: () => ({}),
14+
type: Function
15+
},
16+
17+
store: {
18+
required: true,
19+
type: Object
20+
}
21+
},
22+
23+
data: ctx => ({
24+
state: ctx.store.getState()
25+
}),
26+
27+
created() {
28+
this.unsubscribe = this.store.subscribe(() => {
29+
this.state = this.store.getState();
30+
});
31+
},
32+
33+
destroyed() {
34+
this.unsubscribe();
35+
},
36+
37+
render() {
38+
const nodes = this.$scopedSlots.default(_extends({}, this.mapDispatchToProps(this.store.dispatch), this.mapStateToProps(this.state)));
39+
if (Array.isArray(nodes)) {
40+
return nodes[0];
41+
} else {
42+
return nodes;
43+
}
44+
}
45+
};
46+
47+
export default index;

0 commit comments

Comments
 (0)