-
Notifications
You must be signed in to change notification settings - Fork 215
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
'make' namespace for kinds #10666
base: master
Are you sure you want to change the base?
'make' namespace for kinds #10666
Conversation
|
||
const { make } = organizeMakers({ | ||
...orchestrateAll(flows, {}), | ||
makeSettler: prepareSettler(zone, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about a record like this, but sometimes you have to pass makeA
into prepareB
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh good point. That thought crossed my mind while I was refactoring but it consolidating like this was too delicious
Deploying agoric-sdk with Cloudflare Pages
|
if (!key.startsWith('make')) { | ||
throw new Error(`Unexpected key ${key}`); | ||
} | ||
const newKey = key.slice(4); // Remove 'make' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const newKey = key.slice(4); // Remove 'make' | |
const newKey = key.slice('make'.length); |
make[newKey] = fn; | ||
} | ||
// @ts-expect-error cast | ||
return harden({ make }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a record? why not return make;
? in case there are other facets later or something? that doesn't seem like your style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To enforce that the name used is make
. Though that could be done by a lint rule, like React's useState
does to enforce that the tuple it returns of [state object, state setter] has the the consistent naming [myState, setMyState]
.
variant of #10663
Description
Defines a convention (with a helper) for a
make
object that has kind constructors.Security Considerations
Scaling Considerations
Documentation Considerations
Testing Considerations
Upgrade Considerations