Skip to content

Adding in note about how to handle Futures / Streams #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ Here is a checklist that all Gloo utility crates should fulfill:
`FnOnce`) instead of taking `wasm_bindgen::Closure`s or
`js_sys::Function`s directly.

* [ ] If the API can be implemented as a Future / Stream, then it should first be implemented as a callback, with the callback API put into the `callback` submodule.

Then the Future / Stream should be implemented using the callback API, and should be put into the `future` or `stream` submodule.

Make sure that the callback and Future / Stream APIs properly support cancellation (if it is possible to do so).

* [ ] Uses nice Rust-y types and interfaces instead of passing around untyped
`JsValue`s.

Expand All @@ -120,6 +126,12 @@ Here is a checklist that all Gloo utility crates should fulfill:
escape hatch for dropping down to raw `web_sys` bindings when an API isn't
fully supported by the crate yet.

* [ ] There is a loose hierarchy with "mid-level" APIs (which are essentially thin wrappers over the low-level APIs), and "high-level" APIs (which make more substantial changes).

As a general rule, the high-level APIs should be built on top of the mid-level APIs, which in turn should be built on top of the low-level APIs (e.g. `web_sys`)

There are exceptions to this, but they have to be carefully decided on a case-by-case basis.

* [ ] Headless browser and/or Node.js tests via `wasm-pack test`.

* [ ] Uses `#![deny(missing_docs, missing_debug_implementations)]`.
Expand Down