Skip to content

Commit

Permalink
fix: convert types.d.ts to types.ts
Browse files Browse the repository at this point in the history
definition types does not exist in the build and cause Reducer type to be any

closes #5
  • Loading branch information
Mohammad Hasani authored and the-dr-lazy committed Jan 21, 2019
1 parent 41351e9 commit 852e196
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/create-handler-map.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActionCreator } from './create-action'
import { AnyAction } from './action'
import { getType } from './get-type'
import { Reducer } from './types'

export type HandlerMap<State, Actions extends AnyAction> = {
[key in Actions['type']]: Reducer<State, Actions>
Expand Down
1 change: 0 additions & 1 deletion src/types.d.ts

This file was deleted.

4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type Reducer<State, Actions> = (
prevState: State,
action: Actions
) => State
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.json",
"files": ["./src/index.ts", "./src/types.d.ts"],
"files": ["./src/index.ts"],
"include": [],
"exclude": [],
"compilerOptions": {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.json",
"include": ["./src/**/__tests__/*", "./src/types.d.ts"],
"include": ["./src/**/__tests__/*"],
"compilerOptions": {
"target": "esnext",
"esModuleInterop": true
Expand Down

0 comments on commit 852e196

Please sign in to comment.