Releases: jkb0o/pecs
Releases · jkb0o/pecs
v0.6.0
v0.5.0
v0.4.0
What's Changed
- Update to Bevy 0.11 by @spectria-limina in #7
New Contributors
- @spectria-limina made their first contribution in #7
Full Changelog: v0.3.0...v0.4.0
v0.3.0
v0.2.3
v0.2.1
Summary
- the state inside
asyn!
is not mutable by default - the result arg in the
asyn!
may be omited ()
now implementsInto<PromiseResult>
, you can return nothing fromasyn!
- add
Asyn![R, S => R2, S2]
macro for simplify theasyn!
signature writing - add
PromiseLike
trait to group the API of promise-like constructs (then, map, ect) Promise
isPromiseLike
itself- promises created from
commands.promise(...)
arePromiseLike
, so you can chain - add
Promise::repeat
you can create async loops PromiseState
implDeref
/DerefMut
for its value- add basic
asyn::ui
ops (awaiting for button presses) - more docs
- add
combine_vecs
example to show howany/all
works withVec<Promise>
- add
repeat
example to show how async loops work - add
confirmation
complex example to show how async ui could work - add
system_state
example to show how system params keep state between calls
Detailed
()
now implementsInto<PromiseResult>
, you can return nothing fromasyn!
commands.add(
Promise::start(asyn! {
// resolves as PromiseResult::Resolve((), ())
info!("First call");
})
.then(asyn! {
info!("Second call");
});
- promises created from
commands.promise(...)
arePromiseLike
, so you can chain
// create new promise with state 0
commands
.promise(|| 0)
.then(asyn!(state => {
state.value += 1;
state.asyn().timeout(1.0)
}))
.then(asyn!(state => {
info!("count: {}", state.value);
})); // promises execution scheduled here
- add
Promise::repeat
you can create async loops
// wait 3 times and exit
commands
.promise(|| 3)
.then_repeat(asyn!( state => {
info!("{}", state.value);
state.value -= 1;
let done = state.value == 0;
state.asyn().timeout(1.0).with_result(if done {
Repeat::Break(())
} else {
Repeat::Continue
})
}))
.then(asyn!(_ => {
asyn::app::exit()
}));
Full Changelog: v0.2.0...v0.2.1
v0.2.0
What's Changed
- simplify promise to
Promise<S, R>
(state, result) - only
Promise::then()
left for chaining - only
Promise::resolve(r)
/PromiseState::resolve(r)
left for resolving - no error mapping anymore
- no
.err()
/.ok()
/.reject()
- fix the
Promise::map()
/with()
/map_result()
/with_result()
workflow - any/all implementations for
Vec<Promise>
bypasses its states when resolving - Fix typos and grammar issues in README by @alice-i-cecile in #2
New Contributors
- @alice-i-cecile made their first contribution in #2
Full Changelog: v0.1.2...v0.2.0