mirror of
https://github.com/yewstack/yew.git
synced 2026-01-18 16:16:48 +00:00
24 lines
943 B
Markdown
24 lines
943 B
Markdown
# Memory Game Example
|
|
|
|
[](https://examples.yew.rs/function_memory_game)
|
|
|
|
This is an implementation of [Memory Game](https://github.com/bradlygreen/Memory-Game) for Yew using function components and hooks.
|
|
|
|
## Concepts
|
|
|
|
- Uses [`function_components`](https://yew.rs/docs/next/concepts/function-components)
|
|
- Uses [`gloo::storage`](https://docs.rs/gloo-storage/0.2.0/gloo_storage/index.html) to persist the state
|
|
- Uses [`gloo::timers`](https://docs.rs/gloo-timers/0.2.2/gloo_timers/index.html) to schedule asynchronous callback
|
|
|
|
## Note
|
|
|
|
Images are authorized by [@bradlygreen](https://github.com/bradlygreen), see [authorization-issue](https://github.com/bradlygreen/Memory-Game/issues/6)
|
|
|
|
## Running
|
|
|
|
Run this application with the trunk development server:
|
|
|
|
```bash
|
|
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
|
|
```
|