-
-
Notifications
You must be signed in to change notification settings - Fork 924
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a built-in component for async view loading #2282
Comments
On the first thought: I see this in userland. |
I agree. Promises can be difficult to deal with declaratively, but ultimately this isn't something that involves any Mithril-specific logic, other than a component to store state. I wrote this component to demonstrate the potential of nested vtree functions - |
It's not really mandatory to have in core, and I addressed the primary use of route resolvers (auth) with a much better-suited abstraction. Would you all be okay with an out-of-core-but-officially-blessed This is probably the least significant facet of #2278, and I wouldn't have an issue separating this from that. |
not bundled in core but opt in module would be great thought |
@StephanHoyer Yeah, I'm starting to agree with that thought. I'll remove it from my list in #2278 and just keep it with my (newly filed) #2284. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Updates
signal
as that's what all the various DOM APIs use (and care about) and revised the examples (fixing a bug in the process).Async
instead ofm.async
.onevent
callback per-call form.redraw
#2074.onAbort
callback toinit
for cancelling requests and similar.I'm thinking we could add a new component for async view loading, for things like lazy component initialization based on app state, database loading, and reducing the need for route resolvers (which I'm proposing on partially removing in #2278).
Here's my proposed API:
If you want to reinitialize it, just wrap it in a keyed fragment and pass a new key.
Implementation-wise, it's pretty simple, and could be implemented trivially in userland.
This, of course, is slightly more complicated, but this has the semantics I'd prefer to see mod sync handling of non-promise
return
/throw
.Note that this depends on #2074 (comment).
The text was updated successfully, but these errors were encountered: