Skip to content
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

docs: add some javadoc on E in hopes that it'll be visible in IDEs #2714

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions packages/eventual-send/src/E.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ const makeE = HandledPromise => {
* method calls returns a promise. The method will be invoked on whatever
* 'x' designates (or resolves to) in a future turn, not this one.
*
* An example call would be
*
* E(zoe).install(bundle)
* .then(installationHandle => { ... })
* .catch(err => { ... });
*
* See https://endojs.github.io/endo/functions/_endo_far.E.html for details.
*
* @template T
* @param {T} x target for method/function call
* @returns {ECallableOrMethods<RemoteFunctions<T>>} method/function call proxy
Expand Down
11 changes: 11 additions & 0 deletions packages/eventual-send/src/no-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ import makeE from './E.js';
/** @import {ECallableOrMethods, EGetters, ERef, ERemoteFunctions, ESendOnlyCallableOrMethods, LocalRecord, RemoteFunctions} from './E.js' */

const hp = HandledPromise;

/**
* E(x) returns a proxy on which you can call arbitrary methods. Each of these method calls returns a promise.
* The method will be invoked on whatever 'x' designates (or resolves to) in a future turn, not this one.
*
* E.get(x) returns a proxy on which you can get arbitrary properties. Each of these properties returns a
* promise for the property. The promise value will be the property fetched from whatever 'x' designates (or
* resolves to) in a future turn, not this one.
*
* E.when(x, res, rej) is equivalent to HandledPromise.resolve(x).then(res, rej)
*/
export const E = makeE(hp);
export { hp as HandledPromise };

Expand Down
Loading