1import { useCallback, useRef, useState } from 'react';
3export default function useSetState(initialState = {}) {
4 const initialStateRef = useRef(initialState);
5 const [state, _setState] = useState(initialState);
6 const setState = useCallback(
7 items => _setState(state => ({ ...state, ...items })),
11 const reset = useCallback(() => _setState(initialStateRef.current), [
15 return [state, setState, reset];
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list