Skip to content
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

feature request: export AsyncLoader #86

Open
dakom opened this issue Oct 7, 2024 · 2 comments
Open

feature request: export AsyncLoader #86

dakom opened this issue Oct 7, 2024 · 2 comments

Comments

@dakom
Copy link

dakom commented Oct 7, 2024

Over time, I've come to find this struct is super helpful in all sorts of general scenarios.

It's defined internally in dominator as an example here:

pub struct AsyncLoader {

I've copy/pasted/exported with permission here: https://docs.rs/dominator_helpers/0.8.0/dominator_helpers/futures/struct.AsyncLoader.html

However, that dominator_helpers crate doesn't really do much, and I often find myself importing it for just AsyncLoader

I think it's a good candidate to make part of dominator core

@Pauan
Copy link
Owner

Pauan commented Oct 10, 2024

I'm fine with exporting it, but I think it would be better suited to a different crate, since it's such a generic Future utility.

@dakom
Copy link
Author

dakom commented Oct 10, 2024

I do have it exported in a generic crate here (with attribution in the comments): https://docs.rs/awsm_web/latest/awsm_web/loaders/helpers/struct.AsyncLoader.html

But, there's a few problems:

  1. That crate was my first Rust project, and the demo is currently broken, not a high priority for me to fix it. I'd be surprised if anyone other than myself really relies on it (though the crate itself is stable and heavily feature-gated... I could move AsyncLoader to a futures module so it's not buried among the other loader stuff)

  2. The real reason - I'd be happy to change that to make it dominator-friendly without being dominator-specific, since it's great having is_loading be a Signal ... not sure how to go about that though... maybe it should return a Stream ?

All in all though, fwiw I'd prefer it in Dominator or futures-signals, feels to me like a very useful primitive like map_ref.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants