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
Currently, the design of Client is incredibly basic. This makes usage of this library very easy and straightforward to understand. However, its current implementation constrains too much. For example, fetch only supports JSON-like responses so endpoints like "Downloading source GTFS" (#1) and supporting PNG formats (#4) are impossible.
One potential design would be to make "request functions". For example:
const{ feeds }=awaitclient.fetch(feeds());
This would call exactly to /feeds with no query parameters, and the function would automatically supply (and validate) the response type. That would make calls like this possible assuming an adequate implementation of response handling with these functions:
Currently, the design of
Client
is incredibly basic. This makes usage of this library very easy and straightforward to understand. However, its current implementation constrains too much. For example,fetch
only supports JSON-like responses so endpoints like "Downloading source GTFS" (#1) and supporting PNG formats (#4) are impossible.One potential design would be to make "request functions". For example:
This would call exactly to
/feeds
with no query parameters, and the function would automatically supply (and validate) the response type. That would make calls like this possible assuming an adequate implementation of response handling with these functions:The text was updated successfully, but these errors were encountered: