Skip to content

Commit

Permalink
More type aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
AngryLawyer committed Mar 20, 2019
1 parent 0d08384 commit 35f2520
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/collections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ export * from './types';
export * from './utils';

import { request } from '@dabapps/redux-requests';
import { AxiosResponse } from 'axios';
import * as pathToRegexp from 'path-to-regexp';
import { AnyAction } from 'redux';
import { ThunkAction } from 'redux-thunk';
import {
buildSubgroup,
IdKeyedMap,
SubpathParams,
ThunkResponse,
TypeToRecordMapping,
} from '../utils';
import {
Expand Down Expand Up @@ -52,7 +51,7 @@ export function collectionsFunctor<T extends IdKeyedMap<T>>(
data: any,
subgroup?: string,
url?: string
): ThunkAction<Promise<AxiosResponse | void>, any, null> {
): ThunkResponse {
return request(
ADD_TO_COLLECTION,
url || overrideUrl || `${baseUrl}${type}/`,
Expand Down Expand Up @@ -82,7 +81,7 @@ export function collectionsFunctor<T extends IdKeyedMap<T>>(
type: keyof T,
id: string,
subgroup?: string
): ThunkAction<Promise<AxiosResponse | void>, any, null> {
): ThunkResponse {
const url = overrideUrl
? `${overrideUrl}${id}/`
: `${baseUrl}${type}/${id}/`;
Expand All @@ -99,7 +98,7 @@ export function collectionsFunctor<T extends IdKeyedMap<T>>(
type: keyof T,
opts?: CollectionOptionsNoPageSize,
subgroup?: string
): ThunkAction<Promise<AxiosResponse | void>, any, null> {
): ThunkResponse {
return getCollectionAction(
type,
{
Expand All @@ -114,7 +113,7 @@ export function collectionsFunctor<T extends IdKeyedMap<T>>(
type: keyof T,
options: CollectionOptions = {},
subgroup?: string
): ThunkAction<Promise<AxiosResponse | void>, any, null> {
): ThunkResponse {
const url = overrideUrl || `${baseUrl}${type}/`;
const metaData = {
subgroup: buildSubgroup(overrideUrl, subgroup),
Expand Down

0 comments on commit 35f2520

Please sign in to comment.