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
There are a handful of functions that change their return type based on supplied parameters. This requires us to manually cast the function to the expected type, which isn't ideal. We should replace these functions with versions that either only return one type, or with multiple functions that each return only one type.
Polymorphic functions:
KintoClientBase.execute - Returns HttpResponse<T> if options.raw is true, otherwise T. Can likely be modified to always return HttpResponse<T>.
KintoClientBase.batch - Returns AggregateResponse if options.aggregate is true, otherwise OperationResponse[]. Could possibly just ask the caller to call aggregate on the return value manually.
Collection.listRecords - Returns a snapshot if options.at is provided, otherwise PaginationResult. Turns out this one actually can return the same type regardless of the input.
The text was updated successfully, but these errors were encountered:
There are a handful of functions that change their return type based on supplied parameters. This requires us to manually cast the function to the expected type, which isn't ideal. We should replace these functions with versions that either only return one type, or with multiple functions that each return only one type.
Polymorphic functions:
KintoClientBase.execute
- ReturnsHttpResponse<T>
ifoptions.raw
istrue
, otherwiseT
. Can likely be modified to always returnHttpResponse<T>
.KintoClientBase.batch
- ReturnsAggregateResponse
ifoptions.aggregate
istrue
, otherwiseOperationResponse[]
. Could possibly just ask the caller to callaggregate
on the return value manually.Turns out this one actually can return the same type regardless of the input.Collection.listRecords
- Returns a snapshot ifoptions.at
is provided, otherwisePaginationResult
.The text was updated successfully, but these errors were encountered: