Skip to content

Commit 7f9e5fd

Browse files
Exported Handler type from public API
1 parent a9c9f57 commit 7f9e5fd

File tree

3 files changed

+94
-92
lines changed

3 files changed

+94
-92
lines changed

package.json

Lines changed: 91 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
1-
{
2-
"name": "suspense-service",
3-
"version": "0.2.0",
4-
"description": "Suspense integration library for React",
5-
"repository": "github:patrickroberts/suspense-service",
6-
"main": "dst/cjs/suspense-service.js",
7-
"module": "dst/esm/suspense-service.js",
8-
"browser": "dst/umd/suspense-service.js",
9-
"types": "dst/esm/suspense-service.d.ts",
10-
"scripts": {
11-
"clean": "rimraf dst docs/**/*.md",
12-
"lint": "eslint . --ext .js,.ts,.tsx",
13-
"test": "jest",
14-
"build": "rollup --config --environment NODE_ENV:production",
15-
"rebuild": "npm run clean && npm run build",
16-
"docs": "typedoc src/index.ts",
17-
"watch:build": "npm run build -- --environment NODE_ENV:development --watch",
18-
"watch:test": "npm test -- --watch",
19-
"watch": "concurrently 'npm:watch:*'",
20-
"prepublishOnly": "npm run clean && npm run lint && npm test && npm run build && npm run docs"
21-
},
22-
"author": "Patrick Roberts",
23-
"license": "MIT",
24-
"devDependencies": {
25-
"@babel/preset-react": "^7.10.4",
26-
"@rollup/plugin-commonjs": "^15.1.0",
27-
"@rollup/plugin-node-resolve": "^9.0.0",
28-
"@types/jest": "^26.0.14",
29-
"@types/react": "^16.9.51",
30-
"@types/react-dom": "^16.9.8",
31-
"@types/react-test-renderer": "^16.9.3",
32-
"@typescript-eslint/eslint-plugin": "4.0.1",
33-
"@typescript-eslint/parser": "4.0.1",
34-
"@wessberg/rollup-plugin-ts": "^1.3.5",
35-
"concurrently": "^5.3.0",
36-
"eslint": "^7.10.0",
37-
"eslint-config-airbnb": "^18.2.0",
38-
"eslint-plugin-import": "^2.22.1",
39-
"eslint-plugin-jest": "^24.1.0",
40-
"eslint-plugin-jsx-a11y": "^6.3.1",
41-
"eslint-plugin-react": "^7.21.3",
42-
"eslint-plugin-react-hooks": "^4.1.2",
43-
"jest": "^26.5.3",
44-
"prettier": "^2.1.2",
45-
"react": "^16.13.1",
46-
"react-dom": "^16.13.1",
47-
"react-test-renderer": "^16.14.0",
48-
"rimraf": "^3.0.2",
49-
"rollup": "^2.28.2",
50-
"rollup-plugin-terser": "^7.0.2",
51-
"ts-jest": "^26.4.1",
52-
"typedoc": "^0.19.2",
53-
"typedoc-plugin-markdown": "^3.0.7",
54-
"typedoc-plugin-sourcefile-url": "^1.0.6",
55-
"typescript": "^4.0.3"
56-
},
57-
"peerDependencies": {
58-
"react": "^16.13.1"
59-
},
60-
"keywords": [
61-
"concurrent",
62-
"context",
63-
"data",
64-
"fetching",
65-
"hooks",
66-
"integration",
67-
"library",
68-
"react",
69-
"service",
70-
"suspense",
71-
"typescript"
72-
],
73-
"babel": {
74-
"presets": [
75-
"@babel/preset-react"
76-
]
77-
},
78-
"browserslist": {
79-
"development": [
80-
"last 1 chrome version",
81-
"last 1 firefox version",
82-
"maintained node versions"
83-
],
84-
"production": [
85-
"defaults"
86-
],
87-
"test": [
88-
"maintained node versions"
89-
]
90-
}
91-
}
1+
{
2+
"name": "suspense-service",
3+
"version": "0.2.1",
4+
"description": "Suspense integration library for React",
5+
"repository": "github:patrickroberts/suspense-service",
6+
"main": "dst/cjs/suspense-service.js",
7+
"module": "dst/esm/suspense-service.js",
8+
"browser": "dst/umd/suspense-service.js",
9+
"types": "dst/esm/suspense-service.d.ts",
10+
"scripts": {
11+
"clean": "rimraf dst docs/**/*.md",
12+
"lint": "eslint . --ext .js,.ts,.tsx",
13+
"test": "jest",
14+
"build": "rollup --config --environment NODE_ENV:production",
15+
"rebuild": "npm run clean && npm run build",
16+
"docs": "typedoc src/index.ts",
17+
"watch:build": "npm run build -- --environment NODE_ENV:development --watch",
18+
"watch:test": "npm test -- --watch",
19+
"watch": "concurrently 'npm:watch:*'",
20+
"prepublishOnly": "npm run clean && npm run lint && npm test && npm run build && npm run docs"
21+
},
22+
"author": "Patrick Roberts",
23+
"license": "MIT",
24+
"devDependencies": {
25+
"@babel/preset-react": "^7.10.4",
26+
"@rollup/plugin-commonjs": "^15.1.0",
27+
"@rollup/plugin-node-resolve": "^9.0.0",
28+
"@types/jest": "^26.0.14",
29+
"@types/react": "^16.9.51",
30+
"@types/react-dom": "^16.9.8",
31+
"@types/react-test-renderer": "^16.9.3",
32+
"@typescript-eslint/eslint-plugin": "4.0.1",
33+
"@typescript-eslint/parser": "4.0.1",
34+
"@wessberg/rollup-plugin-ts": "^1.3.5",
35+
"concurrently": "^5.3.0",
36+
"eslint": "^7.10.0",
37+
"eslint-config-airbnb": "^18.2.0",
38+
"eslint-plugin-import": "^2.22.1",
39+
"eslint-plugin-jest": "^24.1.0",
40+
"eslint-plugin-jsx-a11y": "^6.3.1",
41+
"eslint-plugin-react": "^7.21.3",
42+
"eslint-plugin-react-hooks": "^4.1.2",
43+
"jest": "^26.5.3",
44+
"prettier": "^2.1.2",
45+
"react": "^16.13.1",
46+
"react-dom": "^16.13.1",
47+
"react-test-renderer": "^16.14.0",
48+
"rimraf": "^3.0.2",
49+
"rollup": "^2.28.2",
50+
"rollup-plugin-terser": "^7.0.2",
51+
"ts-jest": "^26.4.1",
52+
"typedoc": "^0.19.2",
53+
"typedoc-plugin-markdown": "^3.0.7",
54+
"typedoc-plugin-sourcefile-url": "^1.0.6",
55+
"typescript": "^4.0.3"
56+
},
57+
"peerDependencies": {
58+
"react": "^16.13.1"
59+
},
60+
"keywords": [
61+
"concurrent",
62+
"context",
63+
"data",
64+
"fetching",
65+
"hooks",
66+
"integration",
67+
"library",
68+
"react",
69+
"service",
70+
"suspense",
71+
"typescript"
72+
],
73+
"babel": {
74+
"presets": [
75+
"@babel/preset-react"
76+
]
77+
},
78+
"browserslist": {
79+
"development": [
80+
"last 1 chrome version",
81+
"last 1 firefox version",
82+
"maintained node versions"
83+
],
84+
"production": [
85+
"defaults"
86+
],
87+
"test": [
88+
"maintained node versions"
89+
]
90+
}
91+
}

src/Service/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export default interface Service<TRequest, TResponse> {
2222
[kResource]: IdContext<[Resource<TResponse>, Dispatch<SetStateAction<TRequest>>]>;
2323
}
2424

25+
export { Handler };
26+
2527
const defaultFn = () => { throw new Error('Provider is not in scope'); };
2628
const defaultValue: [Resource<never>, Dispatch<any>] = [defaultFn, defaultFn];
2729

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export { default as IdContextProvider, IdContextProviderProps } from './IdContex
44
export { default as IdContext, createIdContext, useIdContext } from './IdContext';
55
export { default as ServiceConsumer, ServiceConsumerProps } from './Service/Consumer';
66
export { default as ServiceProvider, ServiceProviderProps } from './Service/Provider';
7-
export { default as Service, createService, useService, useServiceState } from './Service';
7+
export { default as Service, Handler, createService, useService, useServiceState } from './Service';
88
export { default as Reset } from './State/Reset';

0 commit comments

Comments
 (0)