Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit 486e3ff

Browse files
committed
resolves #71
resolves #67 resolves #79
1 parent e0b4a66 commit 486e3ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+619
-561
lines changed

default.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { NewGlobalState } from './src/global-state-manager';
2-
import { Dispatchers } from './src/typings/reducer';
1+
import Dispatchers from './typings/dispatchers';
32

43
export type Dispatch = Dispatchers<State, Reducers>;
54

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reactn",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"author": "Charles Stover <[email protected]>",
55
"description": "React, but with built-in global state management.",
66
"homepage": "https://github.com/CharlesStover/reactn#readme",
@@ -18,6 +18,7 @@
1818
},
1919
"files": [
2020
"build",
21+
"typings",
2122
"default.d.ts",
2223
"package.json"
2324
],
@@ -46,8 +47,6 @@
4647
"react": "^16.8.6",
4748
"react-dom": "^16.8.6",
4849
"react-testing-library": "^6.0.4",
49-
"redux": "^4.0.1",
50-
"redux-devtools-extension": "^2.13.8",
5150
"ts-jest": "^24.0.1",
5251
"ts-node": "^8.0.2",
5352
"typescript": "^3.3.1"

src/add-callback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { State } from '../default';
2+
import Callback from '../typings/callback';
23
import GlobalStateManager from './global-state-manager';
3-
import Callback from './typings/callback';
44

55

66

src/add-reducer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { State } from '../default';
2+
import Reducer from '../typings/reducer';
23
import GlobalStateManager from './global-state-manager';
3-
import Reducer from './typings/reducer';
44

55

66

src/add-reducers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Reducers, State } from '../default';
2+
import { AdditionalReducers } from '../typings/reducer';
23
import addReducer from './add-reducer';
34
import GlobalStateManager from './global-state-manager';
4-
import { AdditionalReducers } from './typings/reducer';
55

66

77

@@ -14,7 +14,7 @@ export default function addReducers<
1414
R extends {} = Reducers,
1515
>(
1616
globalStateManager: GlobalStateManager<G, R>,
17-
reducers: AdditionalReducers<G, R>,
17+
reducers: AdditionalReducers<G, R & any>,
1818
): BooleanFunction {
1919

2020
// Amalgamate all the functions to remove these reducers.

src/components.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Reducers, State } from '../default';
2+
import Callback from '../typings/callback';
3+
import { DispatcherMap } from '../typings/dispatchers';
4+
import NewGlobalState from '../typings/new-global-state';
25
import { Component, ComponentClass, PureComponent } from 'react';
3-
import { NewGlobalState } from './global-state-manager';
46
import {
57
ReactNComponentWillUnmount,
68
ReactNComponentWillUpdate,
@@ -9,8 +11,6 @@ import {
911
ReactNGlobalCallback,
1012
ReactNSetGlobal,
1113
} from './methods';
12-
import Callback from './typings/callback';
13-
import { DispatcherMap } from './typings/reducer';
1414

1515

1616

src/create-provider.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import { Reducers, State } from '../default';
2+
import Callback from '../typings/callback';
3+
import Dispatcher, { ExtractArguments } from '../typings/dispatcher';
4+
import Dispatchers from '../typings/dispatchers';
5+
import NewGlobalState from '../typings/new-global-state';
6+
import Reducer, { AdditionalReducers } from '../typings/reducer';
27
import * as React from 'react';
38
import Context from './context';
49
import addReducer from './add-reducer';
510
import addReducers from './add-reducers';
6-
import GlobalStateManager, { NewGlobalState } from './global-state-manager';
11+
import GlobalStateManager from './global-state-manager';
712
import setGlobal from './set-global';
8-
import Callback from './typings/callback';
9-
import Reducer, {
10-
AdditionalReducers,
11-
Dispatcher,
12-
Dispatchers,
13-
ExtractArguments,
14-
} from './typings/reducer';
1513
import useDispatch, { UseDispatch } from './use-dispatch';
1614
import useGlobal, { GlobalTuple, StateTuple, UseGlobal } from './use-global';
1715
import REACT_CONTEXT_ERROR from './utils/react-context-error';

src/decorator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { Reducers, State } from '../default';
2+
import Callback from '../typings/callback';
3+
import Dispatchers from '../typings/dispatchers';
4+
import NewGlobalState from '../typings/new-global-state';
25
import { ComponentClass } from 'react';
36
import { ReactNComponentClass } from './components';
47
import {
@@ -10,9 +13,6 @@ import {
1013
ReactNGlobalCallback,
1114
ReactNSetGlobal,
1215
} from './methods';
13-
import { NewGlobalState } from './global-state-manager';
14-
import Callback from './typings/callback';
15-
import { Dispatchers } from './typings/reducer';
1616

1717

1818

src/get-dispatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Reducers, State } from '../default';
2-
import { Dispatchers } from './typings/reducer';
2+
import Dispatchers from '../typings/dispatchers';
33
import GlobalStateManager from './global-state-manager';
44

55

0 commit comments

Comments
 (0)