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
Side effects (ie network requests) #7
Comments
Hi! Thank you for the issue! I've merged last changes (#11) where I've implemented Timeout service example: https://github.com/DenisKolodin/yew/blob/master/examples/timer/src/main.rs |
Awesome! I'll definitely play around with that. Thanks :). I have an open PR adding network requests to stdweb so if that goes through you could base your fetch request on that (it seems that you are already using stdweb). koute/stdweb#50 |
I was able to get it working by writing a custom network service that used by branch of stdweb. Once I can get that merged in I'll put up the site that I used as an example. For now I'll close this issue because the problem is resolved. |
I mentioned this briefly in the rustlang thread but maybe that conversation would be better continued here.
I'm playing around with this library and I'm a huge fan so far. I'm interested in contributing and so I started making a simple example site to see where the unimplemented parts are of this library so that I could help out. I noticed that there was no paradigm set up for side-effects or asynchronous code, such as network requests. I was able to perform async code and mutate the model using Rc<RefCell<>> but it would not call the view again until another update triggered a re-render.
Elm handles this scenario using Commands. Is this the same way that you want to solve this problem in yew? Or is there another solution that seems more "rusty"?
The text was updated successfully, but these errors were encountered: