-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from MattCCC/improve-compatibility
Improve compatibility
- Loading branch information
Showing
23 changed files
with
1,634 additions
and
998 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
@startuml | ||
|
||
!define RECTANGLE class | ||
|
||
RECTANGLE GlobalConfig { | ||
+baseURL: string | ||
+fetcher: Fetcher | ||
+endpoints: EndpointsSettings | ||
... | ||
[other RequestConfig settings] | ||
} | ||
|
||
note left of GlobalConfig | ||
Configurations can be defined at three levels: | ||
1. Global via createApiFetcher() | ||
2. Per-endpoint in EndpointConfig | ||
3. Per-request in fetchf() or api.yourEndpoint() | ||
end note | ||
|
||
RECTANGLE EndpointConfig { | ||
+url: string | ||
... | ||
[other RequestConfig settings] | ||
} | ||
|
||
RECTANGLE RequestConfig { | ||
+timeout: number | ||
+params: object | ||
+body: object | ||
... | ||
[all other RequestConfig settings] | ||
} | ||
|
||
RECTANGLE ApiFetcher { | ||
+fetchf(endpointNameOrUrl: string, requestConfig: RequestConfig) | ||
} | ||
|
||
RECTANGLE ApiEndpoints { | ||
+api.request(endpointNameOrUrl: string, requestConfig: RequestConfig) | ||
+api.yourEndpoint(requestConfig: RequestConfig) | ||
} | ||
|
||
GlobalConfig --|> EndpointConfig : defines | ||
EndpointConfig --|> RequestConfig : provides defaults | ||
GlobalConfig ..> ApiEndpoints : applies globally | ||
EndpointConfig ..> ApiEndpoints : applies globally | ||
RequestConfig ..> ApiFetcher : per-request settings | ||
RequestConfig ..> ApiEndpoints : per-request settings | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.