2025-03-03 04:53:22 +09:00

24 lines
943 B
Markdown

# Memory Game Example
[![Demo](https://img.shields.io/website?label=demo&url=https%3A%2F%2Fexamples.yew.rs%2Ffunction_memory_game)](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
```