You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Really liking Choo so far! One thing I was missing was the ability to define an async route (I'm working on a game and wanted to preload assets). I didn't see a simple way to accomplish this (maybe I missed something obvious), so I wrote a little module that augments app with an asyncRoute method:
constapp=withAsyncRoute(choo());app.asyncRoute('/',loadResources,()=>html`<divid="root"><h1>Loading...</h1></div>`,(state,emit,data)=>html`<divid="root">Loaded ${data}</div>`(state,emit,err,params)=>{console.error('error loading /:',params,err,state);returnhtml`<divid="root"><h1style="color: red">Error loading / (see console)</h1></div> `;},);
Was wondering if there's interest in either merging this function into Choo proper, or as a third-party npm module?
For reference, here's the module -- it's pretty simple:
Hi,
Really liking Choo so far! One thing I was missing was the ability to define an async route (I'm working on a game and wanted to preload assets). I didn't see a simple way to accomplish this (maybe I missed something obvious), so I wrote a little module that augments app with an
asyncRoute
method:Was wondering if there's interest in either merging this function into Choo proper, or as a third-party npm module?
For reference, here's the module -- it's pretty simple:
The text was updated successfully, but these errors were encountered: