This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
react-rest-request/examples/cancelation/src/endpoint.ts

10 lines
285 B
TypeScript

import { Endpoint, Method } from 'react-rest-request';
export const DelayEndpoint: Endpoint<{ url: string}, void, { seconds: number }> = {
method: Method.GET,
url: ({ seconds }) => `/delay/${seconds}`,
transformResponseData({ url }: any) {
return { url }
}
};