cancellable-promise

Crates.iocancellable-promise
lib.rscancellable-promise
version0.1.0
sourcesrc
created_at2023-08-09 16:50:55.356795
updated_at2023-08-09 16:50:55.356795
descriptionCancellable JS promise in Rust
homepage
repository
max_upload_size
id940199
size2,792
Sven Sauleau (xtuc)

documentation

README

Cancellable JS promise in Rust

Usage

let promise = wasm_bindgen_futures::future_to_promise(async move {
    ...
});

let abort_controller = Box::new(worker::AbortController::default());
let output = cancellable_promise::make(abort_controller.signal(), promise);

// eventually ...

abort_controller.abort();
Commit count: 0

cargo fmt