mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
deploy: leporello-js/app@a6e3f1b36f
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
import {Component} from 'https://unpkg.com/preact?module';
|
||||
|
||||
export const Stateful = ({getInitialState, handlers, render}) => {
|
||||
import { Component } from "preact"
|
||||
|
||||
export const Stateful = ({ getInitialState, handlers, render }) => {
|
||||
return class extends Component {
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
this.compState = getInitialState()
|
||||
this.handlers = Object.fromEntries(
|
||||
Object
|
||||
.entries(handlers)
|
||||
.map(([name, h]) =>
|
||||
[name, this.makeHandler(h)]
|
||||
)
|
||||
Object.entries(handlers).map(([name, h]) => [
|
||||
name,
|
||||
this.makeHandler(h),
|
||||
]),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -27,5 +24,4 @@ export const Stateful = ({getInitialState, handlers, render}) => {
|
||||
return render(this.props, this.compState, this.handlers)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user