Adds an app skeleton. Still needs some work.

This commit is contained in:
Jason Miller
2018-03-12 23:03:31 -04:00
parent 619080f85a
commit e691ec9580
28 changed files with 1826 additions and 917 deletions

View File

@@ -1,3 +1,5 @@
import { Component } from 'preact';
export function updater(obj, property, value) {
return e => {
let update = {};
@@ -8,3 +10,10 @@ export function updater(obj, property, value) {
export const toggle = value => !value;
export class When extends Component {
state = { ready: !!this.props.value };
render({ value, children: [child] }, { ready }) {
if (value && !ready) this.setState({ ready: true });
return ready ? (typeof child === 'function' ? child() : child) : null;
}
}