Martin Matusiak 7ce0bd8d3a
Fix broken examples (#1289) - batch #1 (#1340)
* Update run instructions

`python3 -m http.server --directory` flag was added in Python 3.7.
Change instructions to cd into static and skip the flag instead -
makes it work with earlier Pythons too.

* Add visual feedback for button click

The minimal example has a button, but clicking it does nothing. This
makes it hard to tell whether the example works or not.

This adds a label that is update when the button is clicked.

* Small improvements to crm example

* Add a heading to each scene to make it more obvious what the page is
for.

* Improve layout of input form by stack the inputs vertically.

* Add a little space between entries when displaying the list.

* Add a hint to the Description input that Markdown can be used.

* Add an explanation to the file_upload example

* Clarify purpose of var in fragments example

* Improve futures_wp example

* Add a second button that demonstrates an unsuccessful fetch.

* Render the markdown document (since we're fetching markdown after
all).

* Remove vague comment that's not really helping.

* Improve inner_html example

* Include a textual explanation of what the example is doing.

* Run cargo fmt

* Remove 'static lifetime for constant

* Improve suggestion in inner_html example

* move markdown.rs to a common crate

* add description to common Cargo.toml

* PR feedback

* PR feedback

* remove static lifetime annotation
2020-06-26 20:29:58 +08:00
..

Futures Example

This example shows off how to make a asynchronous fetch request using web_sys and Yew's futures support.

How to run:

This example requires rustc v1.39.0 or above to compile due to its use of async/.await syntax.

wasm-pack build --target web --out-dir ../static/ --out-name wasm && python -m SimpleHTTPServer 8080

This will compile the project, bundle up the compiler output and static assets, and start a http server on port 8080 so you can access the example at localhost:8080.

It is expected that you have a setup with wasm-pack and python installed.