Refactor components

Implement context mechanism to pass default attributes to descendant
components.
This commit is contained in:
Zaid Abdulla committed 2019-02-12 23:11:27 -08:00
1 parent d46d133878
commit ee8c43747e
35 files changed
+1903 -1831

No files matched your search

+8 -8
View File
@@ -1,6 +1,6 @@
"use strict";
import m from "mithril";
import { m } from "./components";
import { stringify } from "../lib/common/expression-parser";
import memoize from "../lib/common/memoize";
@@ -115,10 +115,10 @@ const drawChart = function(chartData) {
]);
};
const component = {
view: vnode => {
return drawChart(vnode.attrs.chart);
}
};
export default component;
export default function component() {
return {
view: vnode => {
return drawChart(vnode.attrs.chart);
}
};
}