Try adding types again

This commit is contained in:
Kyle Corbelli committed 2017-09-03 06:41:20 -07:00
1 parent 9d51f01861
commit 57e3e27d08
11 files changed
+29 -13

No files matched your search

+2 -3
View File
@@ -1,5 +1,4 @@
import axios from 'axios'
// import { authUrl } from '../../constants' // this has to be passed in by the package user
import { Dispatch } from 'redux'
import {
AuthResponse,
@@ -8,6 +7,7 @@ import {
UserRegistrationDetails,
UserSignInCredentials,
UserSignOutCredentials,
ActionsExport,
REGISTRATION_REQUEST_SENT,
REGISTRATION_REQUEST_SUCCEEDED,
REGISTRATION_REQUEST_FAILED,
@@ -105,8 +105,7 @@ export const signOutRequestFailed = (): SignOutRequestFailedAction => ({
// Async Redux Thunk actions:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Maybe type this even:
const theActionsExportThatShouldBeRenamed = (authUrl: string) => {
const theActionsExportThatShouldBeRenamed = (authUrl: string): ActionsExport => {
const registerUser = (
userRegistrationDetails: UserRegistrationDetails,
) => async function (dispatch: Dispatch<{}>): Promise<void> {
+5 -2
View File
@@ -1,7 +1,10 @@
import { combineReducers } from 'redux'
import {
combineReducers,
Reducer,
} from 'redux'
import currentUser from './current-user'
const reduxTokenAuthReducer = combineReducers({
const reduxTokenAuthReducer: Reducer<{}> = combineReducers({
currentUser,
})
+10 -1
View File
@@ -1,4 +1,4 @@
// Maybe make this the index.ts of a types directory so you can split things up
import { Dispatch } from 'redux'
// This one in particular will be a little tough because we don't know what the package user's "User" model looks like:
export interface UserAttributes {}
@@ -154,3 +154,12 @@ export type ReduxAction = RegistrationRequestSentAction
| SignOutRequestSentAction
| SignOutRequestSucceededAction
| SignOutRequestFailedAction
export type ReduxAsyncAction = (input: any) => (dispatch: Dispatch<{}>) => Promise<void>
export interface ActionsExport {
readonly registerUser: ReduxAsyncAction
readonly verifyToken: ReduxAsyncAction
readonly signInUser: ReduxAsyncAction
readonly signOutUser: ReduxAsyncAction
}