You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: .get is confusing, but we need a way to get a reference to a given resource. We decided on a combo approach of renaming .get and adding the reference to the response of async calls.
From #39:
Return reference object in response from async operations.
- Example: const { resource: db} = client.databases.create({id: foo});
- Pros: Helps reduce number of lines of code for many scenarios (like db and container create)
- Cons: Doesn't remove need for .get because we don't want to force an async operation just to get a reference. Won't work with Steve's idea for simplifying the response types.
Additionally, we'll rename result to body to
Implementation details:
interfaceCosmosResponse<T,U>{body: T;headers: Headers;ref: U;}interfaceDatabaseResponseextendsCosmosResponse<DatabaseDefinition,Database>{body: DatabaseDefinition;headers: Headers;ref: Database;database: Database;}/* Similar pattern for other types */
The text was updated successfully, but these errors were encountered:
Problem:
.get
is confusing, but we need a way to get a reference to a given resource. We decided on a combo approach of renaming .get and adding the reference to the response of async calls.From #39:
Additionally, we'll rename
result
tobody
toImplementation details:
The text was updated successfully, but these errors were encountered: