Skip to content

Commit fd7ad98

Browse files
docs: add some javadoc on E in hopes that it'll be visible in IDEs (#2714)
Closes: #2706 ## Description Add some documentation on *E*, in hopes that it will appear as hovertext in IDEs. Also added an example and a link to the API Documentation. ### Security Considerations No impact ### Scaling Considerations No consequences. ### Documentation Considerations No change to any interface. The goal is to add jsDoc to E. ### Testing Considerations I don't know how to test this before it's deployed. In WebStorm, I was able to see the comment when hovering on *E* in `no-shim.js`, but not anywhere else. ### Compatibility Considerations No effects ### Upgrade Considerations None
1 parent 1bf94a1 commit fd7ad98

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

packages/eventual-send/src/E.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ const makeE = HandledPromise => {
195195
* method calls returns a promise. The method will be invoked on whatever
196196
* 'x' designates (or resolves to) in a future turn, not this one.
197197
*
198+
* An example call would be
199+
*
200+
* E(zoe).install(bundle)
201+
* .then(installationHandle => { ... })
202+
* .catch(err => { ... });
203+
*
204+
* See https://endojs.github.io/endo/functions/_endo_far.E.html for details.
205+
*
198206
* @template T
199207
* @param {T} x target for method/function call
200208
* @returns {ECallableOrMethods<RemoteFunctions<T>>} method/function call proxy

packages/eventual-send/src/no-shim.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ import makeE from './E.js';
55
/** @import {ECallableOrMethods, EGetters, ERef, ERemoteFunctions, ESendOnlyCallableOrMethods, LocalRecord, RemoteFunctions} from './E.js' */
66

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

0 commit comments

Comments
 (0)