An open API service indexing awesome lists of open source software.

https://github.com/xtuc/cancellable-promise-rs


https://github.com/xtuc/cancellable-promise-rs

Last synced: about 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# Cancellable JS promise in Rust

## Usage

```rust
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();
```