Skip to content

Commit

Permalink
edit readme and docs for v0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Madoshakalaka committed Jan 1, 2022
1 parent 6f48898 commit 8b4b519
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 654 deletions.
20 changes: 17 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<h1>Yew Interop</h1>
<img alt="Crates.io" src="https://img.shields.io/crates/v/yew-interop">
<a href="https://madoshakalaka.github.io/yew-interop/v0.2.0"><img alt="demo badge" src="https://img.shields.io/badge/demo%20v0.2.0-up-brightgreen"/></a>
<a href="https://madoshakalaka.github.io/yew-interop/v0.2.1"><img alt="demo badge" src="https://img.shields.io/badge/demo%20v0.2.1-up-brightgreen"/></a>
<a href="https://madoshakalaka.github.io/yew-interop/master"><img alt="demo badge" src="https://img.shields.io/badge/demo%20master-up-brightgreen"/></a>
</div>

Expand All @@ -28,15 +28,15 @@ or return ready immediately if the resource is loaded.

## Demo

[The example folder](https://github.com/Madoshakalaka/yew-interop/tree/v0.2.0/example)
[The example folder](https://github.com/Madoshakalaka/yew-interop/tree/v0.2.1/example)
has a demo website built with`yew-interop`

The gif below shows the first two use cases,
loading speed is throttled for demo purposes.

![yew interop demo gif](https://madoshakalaka.github.io/yew-interop/v0.2.0/static/yew-interop-demo.gif)
![yew interop demo gif](https://madoshakalaka.github.io/yew-interop/v0.2.1/static/yew-interop-demo.gif)

[Check out the full online demo](https://madoshakalaka.github.io/yew-interop/v0.2.0)
[Check out the full online demo](https://madoshakalaka.github.io/yew-interop/v0.2.1)

# Install

Expand All @@ -45,7 +45,7 @@ yew-interop = "0.2"
```

This should work with yew `0.19.x`,
in particular, `0.2.0` is tested against yew `0.19.3`.
in particular, `0.2.1` is tested against yew `0.19.3`.

# API

Expand Down Expand Up @@ -112,7 +112,7 @@ pub fn consumer() -> Html {
>For javascript libraries,
you will also need to write some stubs using `wasm-bindgen` and `js-sys` before using the library in Rust.
The wasm-bindgen book has [a good chapter](https://rustwasm.github.io/wasm-bindgen/examples/import-js.html) on that.
You can also check out our demo website and have a look [how it's done there](https://github.com/Madoshakalaka/yew-interop/blob/v0.2.0/example/src/interop.rs)
You can also check out our demo website and have a look [how it's done there](https://github.com/Madoshakalaka/yew-interop/blob/v0.2.1/example/src/interop.rs)

## Explicit Resource Type

Expand Down Expand Up @@ -156,7 +156,7 @@ you want to enable the `script` feature.


```toml
yew-interop = {git="https://github.com/Madoshakalaka/yew-interop.git", features=["yew-stable", "script"]}
yew-interop = {version = "0.2", features=["script"]}
```

You will need to prepend the identifier of a script with an exclamation mark (!).
Expand Down Expand Up @@ -211,7 +211,7 @@ pub fn app() -> Html {
```

If your script depends on other components being rendered,
such as the fourth example [in the demo](https://madoshakalaka.github.io/yew-interop/v0.2.0/static/yew-interop-demo.gif),
such as the fourth example [in the demo](https://madoshakalaka.github.io/yew-interop/v0.2.1/static/yew-interop-demo.gif),
where the script adds onclick handlers to the rendered elements,
you will need to guarantee the script is rendered after all the dependees.

Expand Down
Loading

0 comments on commit 8b4b519

Please sign in to comment.