Crates.io | cancellable-promise |
lib.rs | cancellable-promise |
version | 0.1.0 |
source | src |
created_at | 2023-08-09 16:50:55.356795 |
updated_at | 2023-08-09 16:50:55.356795 |
description | Cancellable JS promise in Rust |
homepage | |
repository | |
max_upload_size | |
id | 940199 |
size | 2,792 |
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();