increase prettier line length to 120 (#233)
* [Prettier] Increase max line length to 120 100 is quite low, especially on modern monitors. The length is also reached quite quickly with 4 spaces per tab depending on the indentation depth * [Prettier] Increase max line length to 120 - Fix formatting
This commit is contained in:
@@ -9,10 +9,7 @@ import React, { useState, Dispatch, SetStateAction, useReducer, Reducer, useCall
|
||||
import storage from 'util/localStorage';
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
export default function useLocalStorage<T>(
|
||||
key: string,
|
||||
defaultValue: T | (() => T),
|
||||
): [T, Dispatch<SetStateAction<T>>] {
|
||||
export default function useLocalStorage<T>(key: string, defaultValue: T | (() => T)): [T, Dispatch<SetStateAction<T>>] {
|
||||
const initialState = defaultValue instanceof Function ? defaultValue() : defaultValue;
|
||||
const [storedValue, setStoredValue] = useState<T>(storage.getItem(key, initialState));
|
||||
|
||||
@@ -31,11 +28,7 @@ export default function useLocalStorage<T>(
|
||||
return [storedValue, setValue];
|
||||
}
|
||||
|
||||
export function useReducerLocalStorage<S, A>(
|
||||
reducer: Reducer<S, A>,
|
||||
key: string,
|
||||
defaultState: S | (() => S),
|
||||
) {
|
||||
export function useReducerLocalStorage<S, A>(reducer: Reducer<S, A>, key: string, defaultState: S | (() => S)) {
|
||||
const [storedValue, setValue] = useLocalStorage(key, defaultState);
|
||||
return useReducer((state: S, action: A): S => {
|
||||
const newState = reducer(state, action);
|
||||
|
||||
Reference in New Issue
Block a user