Open algebraic-brain opened 6 years ago
Thanks a lot for this boilerplate.
I used it with simplest hyperapp code:
import { h, app } from "hyperapp" const state = { count: 0 } const actions = { down: () => state => ({ count: state.count - 1 }), up: () => state => ({ count: state.count + 1 }) } const view = (state, actions) => ( <main> <h1>{state.count}</h1> <button onclick={actions.down}>-</button> <button onclick={actions.up}>+</button> </main> ) const main = app(state, actions, view, document.body)
And everything works just fine.
But I need this to be made async in order to add await calls inside:
async
await
import { h, app } from "hyperapp" async function appEntry() { const state = { count: 0 } const actions = { down: () => state => ({ count: state.count - 1 }), up: () => state => ({ count: state.count + 1 }) } const view = (state, actions) => ( <main> <h1>{state.count}</h1> <button onclick={actions.down}>-</button> <button onclick={actions.up}>+</button> </main> ) window.main = app(state, actions, view, document.body) } appEntry();
and now I have the following problem:
[!] (uglify plugin) Error: Error transforming bundle with 'uglify' plugin: Unexpected token: keyword (function)
This error disappears when I remove async keyword. What I do wrong? Please help.
Thank you @algebraic-brain
Now hyperapp-rollup support async.
hyperapp-rollup
Thanks a lot for this boilerplate.
I used it with simplest hyperapp code:
And everything works just fine.
But I need this to be made
async
in order to addawait
calls inside:and now I have the following problem:
This error disappears when I remove
async
keyword. What I do wrong? Please help.