Merge pull request #741 from streamich/update-yarn-lock

feat: recreate yarn.lock
This commit is contained in:
Anton Zinovyev 2019-11-04 12:14:40 +03:00 committed by GitHub
commit ced3556865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1613 additions and 2686 deletions

View File

@ -46,13 +46,13 @@
},
"homepage": "https://github.com/streamich/react-use#readme",
"dependencies": {
"copy-to-clipboard": "^3.1.0",
"nano-css": "^5.1.0",
"copy-to-clipboard": "^3.2.0",
"nano-css": "^5.2.1",
"react-fast-compare": "^2.0.4",
"resize-observer-polyfill": "^1.5.1",
"screenfull": "^5.0.0",
"set-harmonic-interval": "^1.0.1",
"throttle-debounce": "^2.0.1",
"throttle-debounce": "^2.1.0",
"ts-easing": "^0.2.0",
"tslib": "^1.10.0"
},
@ -103,7 +103,7 @@
"semantic-release": "15.13.30",
"ts-loader": "6.2.1",
"ts-node": "8.4.1",
"tslint": "5.20.0",
"tslint": "6.0.0-beta0",
"tslint-config-prettier": "1.18.0",
"tslint-eslint-rules": "5.4.0",
"tslint-plugin-prettier": "2.0.1",

View File

@ -6,9 +6,9 @@ describe('useTitle', () => {
expect(useTitle).toBeDefined();
});
const hook = renderHook(props => useTitle(props), { initialProps: 'My page title' });
it('should update document title', () => {
const hook = renderHook(props => useTitle(props), { initialProps: 'My page title' });
expect(document.title).toBe('My page title');
hook.rerender('My other page title');
expect(document.title).toBe('My other page title');

View File

@ -10,7 +10,7 @@ interface Store<Action, State> {
type Middleware<Action, State> = (store: Store<Action, State>) => (next: Dispatch<Action>) => (action: Action) => void;
function composeMiddleware<Action, State>(chain: Array<Middleware<Action, State>>) {
function composeMiddleware<Action, State>(chain: Middleware<Action, State>[]) {
return (context: Store<Action, State>, dispatch: Dispatch<Action>) => {
return chain.reduceRight((res, middleware) => {
return middleware(context)(res);
@ -18,7 +18,7 @@ function composeMiddleware<Action, State>(chain: Array<Middleware<Action, State>
};
}
const createReducer = <Action, State>(...middlewares: Array<Middleware<Action, State>>) => {
const createReducer = <Action, State>(...middlewares: Middleware<Action, State>[]) => {
const composedMiddleware = composeMiddleware<Action, State>(middlewares);
return (

View File

@ -1,9 +1,11 @@
import { useEffect } from 'react';
import { useRef } from 'react';
const useTitle = (title: string) => {
useEffect(() => {
document.title = title;
}, [title]);
const t = useRef<string>();
if (t.current !== title) {
document.title = t.current = title;
}
};
export default useTitle;

View File

@ -1,5 +1,5 @@
const parseTimeRanges = ranges => {
const result: Array<{ start: number; end: number }> = [];
const result: { start: number; end: number }[] = [];
for (let i = 0; i < ranges.length; i++) {
result.push({

4271
yarn.lock

File diff suppressed because it is too large Load Diff