-
Notifications
You must be signed in to change notification settings - Fork 21
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
chore: update readme and examples for default credential provider and new topics callbacks #1429
Conversation
… new topics callbacks
|
||
async function main() { | ||
const cacheClient = await CacheClient.create({ | ||
configuration: Configurations.Laptop.v1(), | ||
credentialProvider: CredentialProvider.fromEnvironmentVariable('MOMENTO_API_KEY'), |
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.
configuration
is actually optional now too; I just never went and updated the docs. (so thank you for being diligent about it!)
I think we should leave plenty of examples of how to explicitly set these so that people will know, but in the examples where we omit them, we should omit both. I think this file is a good place to omit both, and whatever shows up in the main README is another good spot. Maybe also in the most basic example file for each product. But probably the rest of the places (e.g. the dictionary example) I'd leave the explicit versions in.
You can use your judgment on which files to update vs leave explicit, but let's go ahead and remove the explicit configuration
option from any of the ones where you remove credentialProvider
.
configuration: StorageConfigurations.Laptop.latest(), | ||
credentialProvider: CredentialProvider.fromEnvironmentVariable('MOMENTO_API_KEY'), | ||
}); | ||
const storageClient = new PreviewStorageClient({}); |
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.
should the props object itself become optional then?
removing the {}
results in an Expected 1 arguments, but got 0
error.
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.
good call, we could do that later, but I don't think it's a blocker for now.
Closes https://github.com/momentohq/dev-eco-issue-tracker/issues/975
onDiscontinuity
andonHeartbeat
topics callbacks