Skip to content

Commit

Permalink
api types [nfc]: Make a bogus empty explicit.
Browse files Browse the repository at this point in the history
This is the type Flow was already inferring here, as a result of,
ultimately, `fetch` having a type of `any` in the libdef RN provides.
Make it a little more explicit that that's happening.
  • Loading branch information
gnprice committed Jul 14, 2021
1 parent 0595a40 commit 4ef0f06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/apiFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ export const apiFetch = async (
params: $Diff<$Exact<RequestOptions>, {| headers: mixed |}>,
) => fetch(new URL(`/${apiVersion}/${route}`, auth.realm).toString(), getFetchParams(auth, params));

/** (Caller beware! Return type is the magic `empty`.) */
export const apiCall = async (
auth: Auth,
route: string,
params: $Diff<$Exact<RequestOptions>, {| headers: mixed |}>,
isSilent: boolean = false,
) => {
): Promise<empty> => {
try {
networkActivityStart(isSilent);
const response = await apiFetch(auth, route, params);
Expand Down

0 comments on commit 4ef0f06

Please sign in to comment.