forked from henrikruscon/hyper-statusline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (29 loc) · 886 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import decorateConfig from "./src/utils/decorateConfig";
import StatusLine, { middleware } from "./src/components/StatusLine/StatusLine";
exports.decorateConfig = decorateConfig;
exports.decorateHyper = (Hyper, { React }) =>
class extends React.Component {
constructor(props) {
super(props);
}
componentDidUnmount() {
clearInterval(this.interval);
}
render() {
const { customChildren } = this.props;
const existingChildren = customChildren
? customChildren instanceof Array
? customChildren
: [customChildren]
: [];
return React.createElement(
Hyper,
Object.assign({}, this.props, {
customInnerChildren: existingChildren.concat(
React.createElement(StatusLine, { config }, null)
)
})
);
}
};
exports.middleware = middleware;