Skip to content

Commit

Permalink
DOC: update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
not-elm committed May 4, 2024
1 parent 3687902 commit 6a48742
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.4.0

added effect actions.

- [v0.4.0](https://github.com/not-elm/bevy_flurx/pull/42)

## v0.3.4

- [v0.3.4](https://github.com/not-elm/bevy_flurx/pull/38)
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "bevy_flurx"
version = "0.3.4"
version = "0.4.0"
edition = "2021"
authors = ["elm"]
categories = ["asynchronous", "game-development"]
description = "Provides the ability to wait for game status asynchronously."
description = "Allows you to write sequential description of processes involving delays, user input, and other waits."
keywords = ["game", "gamedev", "bevy", "async"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
36 changes: 33 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,39 @@ fn spawn_reactor(
```
## Highlights of the latest version

As a highlight feature, we have added a record that allows for easy undo and redo.
Added a mechanism to convert asynchronous processing outside of bevy into actions.

![examples/undo_redo.gif](examples/undo_redo.gif)
```rust

fn spawn_reactor(
mut commands: Commands
) {
commands.spawn(Reactor::schedule(|task| async move {
task.will(Update, effect::bevy_task::spawn(async move {
tokio::time::sleep(std::time::Duration::from_millis(300)).await;
})).await;

task.will(Update, {
once::run(|| {
300
})
.pipe(effect::bevy_task::spawn(|millis: u64| async move {
tokio::time::sleep(std::time::Duration::from_millis(millis)).await;
}))
}).await;

// not support on wasm32
task.will(Update, effect::thread::spawn(|_| {
std::thread::sleep(std::time::Duration::from_millis(300));
})).await;

// not support on wasm32 and require [`tokio`] feature flag
task.will(Update, effect::tokio::spawn(async move {
tokio::time::sleep(std::time::Duration::from_millis(300)).await;
})).await;
}));
}
```

## Example

Expand All @@ -58,7 +88,7 @@ Please see [here](https://github.com/not-elm/bevy_flurx/blob/main/CHANGELOG.md).
|---------------|--------|
| 0.3.0 | 0.13.0 |
| 0.3.1 | 0.13.1 |
| 0.3.2 ~ 0.3.4 | 0.13.2 |
| 0.3.2 ~ 0.4.0 | 0.13.2 |

## License

Expand Down

0 comments on commit 6a48742

Please sign in to comment.