@42.nl/react-flash-messages 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/hooks.js +2 -2
- package/lib/provider.js +1 -1
- package/package.json +27 -31
- package/CHANGELOG.md +0 -6
package/lib/hooks.js
CHANGED
|
@@ -8,8 +8,8 @@ const service_1 = require("./service");
|
|
|
8
8
|
* flash message store.
|
|
9
9
|
*/
|
|
10
10
|
function useFlashMessages() {
|
|
11
|
-
const [state, setState] = react_1.useState(service_1.flashMessageService.getFlashMessages());
|
|
12
|
-
react_1.useEffect(() => {
|
|
11
|
+
const [state, setState] = (0, react_1.useState)(service_1.flashMessageService.getFlashMessages());
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
13
|
const subscriber = (nextState) => {
|
|
14
14
|
setState(nextState);
|
|
15
15
|
};
|
package/lib/provider.js
CHANGED
|
@@ -16,7 +16,7 @@ exports.FlashMessagesContext = react_1.default.createContext(service_1.flashMess
|
|
|
16
16
|
* @param children The children to render
|
|
17
17
|
*/
|
|
18
18
|
function FlashMessagesProvider({ children }) {
|
|
19
|
-
const flashMessages = hooks_1.useFlashMessages();
|
|
19
|
+
const flashMessages = (0, hooks_1.useFlashMessages)();
|
|
20
20
|
return (react_1.default.createElement(exports.FlashMessagesContext.Provider, { value: flashMessages }, children));
|
|
21
21
|
}
|
|
22
22
|
exports.FlashMessagesProvider = FlashMessagesProvider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@42.nl/react-flash-messages",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Storing flash messages via a nice api for use with React.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib"
|
|
@@ -21,29 +21,28 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/42BV/flash-messages#readme",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@testing-library/
|
|
25
|
-
"@testing-library/
|
|
26
|
-
"@types/jest": "
|
|
27
|
-
"@types/react": "17.0.
|
|
28
|
-
"@types/react-dom": "17.0.
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "
|
|
30
|
-
"@typescript-eslint/parser": "
|
|
31
|
-
"eslint": "
|
|
32
|
-
"eslint-config-react-app": "
|
|
33
|
-
"eslint-plugin-jest": "
|
|
34
|
-
"eslint-plugin-react": "7.
|
|
35
|
-
"eslint-plugin-react-hooks": "4.
|
|
36
|
-
"
|
|
37
|
-
"jest
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"react": "17.0.
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"np": "7.0.0"
|
|
24
|
+
"@testing-library/jest-dom": "5.16.2",
|
|
25
|
+
"@testing-library/react": "12.1.4",
|
|
26
|
+
"@types/jest": "27.4.1",
|
|
27
|
+
"@types/react": "17.0.40",
|
|
28
|
+
"@types/react-dom": "17.0.13",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "5.14.0",
|
|
30
|
+
"@typescript-eslint/parser": "5.14.0",
|
|
31
|
+
"eslint": "8.10.0",
|
|
32
|
+
"eslint-config-react-app": "7.0.0",
|
|
33
|
+
"eslint-plugin-jest": "26.1.1",
|
|
34
|
+
"eslint-plugin-react": "7.29.3",
|
|
35
|
+
"eslint-plugin-react-hooks": "4.3.0",
|
|
36
|
+
"husky": "7.0.4",
|
|
37
|
+
"jest": "27.5.1",
|
|
38
|
+
"jest-watch-typeahead": "1.0.0",
|
|
39
|
+
"lint-staged": "12.3.5",
|
|
40
|
+
"np": "^7.6.0",
|
|
41
|
+
"prettier": "2.5.1",
|
|
42
|
+
"react": "17.0.2",
|
|
43
|
+
"react-dom": "17.0.2",
|
|
44
|
+
"ts-jest": "27.1.3",
|
|
45
|
+
"typescript": "4.6.2"
|
|
47
46
|
},
|
|
48
47
|
"scripts": {
|
|
49
48
|
"start": "jest --watch --coverage",
|
|
@@ -58,7 +57,8 @@
|
|
|
58
57
|
"lint:src": "eslint \"src/**\" --max-warnings=0",
|
|
59
58
|
"release": "npm run tsc && np --otp",
|
|
60
59
|
"dev:publish": "./scripts/dev-publish.sh",
|
|
61
|
-
"version": "npm run tsc && jekyll build"
|
|
60
|
+
"version": "npm run tsc && jekyll build",
|
|
61
|
+
"prepare": "husky install"
|
|
62
62
|
},
|
|
63
63
|
"jest": {
|
|
64
64
|
"preset": "ts-jest",
|
|
@@ -81,16 +81,12 @@
|
|
|
81
81
|
"watchPlugins": [
|
|
82
82
|
"jest-watch-typeahead/filename",
|
|
83
83
|
"jest-watch-typeahead/testname"
|
|
84
|
-
]
|
|
84
|
+
],
|
|
85
|
+
"testEnvironment": "jsdom"
|
|
85
86
|
},
|
|
86
87
|
"lint-staged": {
|
|
87
88
|
"{src,test}/**/*.{js,jsx,json,scss,tsx,ts}": [
|
|
88
89
|
"prettier --single-quote --trailing-comma none --write"
|
|
89
90
|
]
|
|
90
|
-
},
|
|
91
|
-
"husky": {
|
|
92
|
-
"hooks": {
|
|
93
|
-
"pre-commit": "lint-staged"
|
|
94
|
-
}
|
|
95
91
|
}
|
|
96
92
|
}
|