Skip to content

Commit af15af8

Browse files
committed
Remove createRequestGenerator for consistency
1 parent 4795b9e commit af15af8

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/helpers/request.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ export const createRequestHandler = <Args>(
4141
};
4242
};
4343

44-
export const createRequestGenerator = <Args, T>(handlers: RequestGenerator<Args, T>) => handlers;
45-
4644
/**
4745
* Initial parameters that apply to all calls
4846
*/

src/methods/topics/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { handleFeedResponse } from '../../helpers/feed';
22
import { compactDefined, flow } from '../../helpers/fp';
33
import * as Query from '../../helpers/query';
4-
import { createRequestGenerator } from '../../helpers/request';
54
import { castResponse } from '../../helpers/response';
65
import { OmitStrict } from '../../helpers/typescript';
76
import { OrientationParam, PaginationParams } from '../../types/request';
@@ -18,7 +17,7 @@ const getTopicPhotosPath = flow(getTopicPath, topicPath => `${topicPath}/photos`
1817

1918
type TopicOrderBy = 'latest' | 'oldest' | 'position' | 'featured';
2019

21-
export const list = createRequestGenerator({
20+
export const list = {
2221
handleRequest: ({
2322
page,
2423
perPage,
@@ -39,17 +38,17 @@ export const list = createRequestGenerator({
3938
}),
4039
}),
4140
handleResponse: handleFeedResponse<Topic.Basic>(),
42-
});
41+
};
4342

44-
export const get = createRequestGenerator({
43+
export const get = {
4544
handleRequest: ({ topicIdOrSlug }: TopicIdOrSlug) => ({
4645
pathname: getTopicPath({ topicIdOrSlug }),
4746
query: {},
4847
}),
4948
handleResponse: castResponse<Topic.Full>(),
50-
});
49+
};
5150

52-
export const getPhotos = createRequestGenerator({
51+
export const getPhotos = {
5352
handleRequest: ({
5453
topicIdOrSlug,
5554
orientation,
@@ -62,4 +61,4 @@ export const getPhotos = createRequestGenerator({
6261
}),
6362
}),
6463
handleResponse: handleFeedResponse<Photo.Basic>(),
65-
});
64+
};

0 commit comments

Comments
 (0)