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

Add send_future to ComponentLink #717

Merged
merged 16 commits into from Nov 11, 2019
Merged

Conversation

hgzimmerman
Copy link
Member

@hgzimmerman hgzimmerman commented Oct 26, 2019

Closes #686
Based on prior work in plaster.

This PR aims to add limited Futures support to Yew by way of registering futures that will send messages to component event loops when they complete.


Edit: The provided example code demonstrates a working version of using futures to make fetch requests using faculties exposed by web_sys.

Copy link
Member

@jstarry jstarry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome! Really great to have futures support finally! Thanks @hgzimmerman !!

examples/futures/src/lib.rs Outdated Show resolved Hide resolved
examples/futures/src/lib.rs Outdated Show resolved Hide resolved
examples/futures/src/lib.rs Outdated Show resolved Hide resolved
examples/futures/README.md Outdated Show resolved Hide resolved
@jstarry jstarry changed the base branch from futures to master November 10, 2019 22:24
@jstarry jstarry merged commit f60e533 into yewstack:master Nov 11, 2019
llebout pushed a commit to llebout/yew that referenced this pull request Jan 20, 2020
* bump wasm-bindgen to 0.2.51 (yewstack#681)

* upgrade wasm-bindgen to 0.2.51

* Run macro tests on beta and update readme

* Update README.md

* Update .travis.yml

* implement send_future

* cargo fmt

* add todo question

* static dispatch on Error in future

* Add framework for example using futures

* add a basic future to indicate that futures work

* change example to fetch markdown instead of just resolving a string

* remove unnneded import

* Force users to handle errors in their future

* Force users to handle errors in their future

* cleanup and introduction of FetchState

* respond to feedback

* update comment

* fix cargo.toml dependency issues
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

Successfully merging this pull request may close these issues.

Add Futures support to the component event loop
3 participants