1import React, { createContext, forwardRef, useContext, useState } from 'react';
3export const PointCacheContext = createContext(null);
5function _usePointCache() {
6 const [pointCache, _setPointCache] = useState({});
8 const addToPointCache = entry =>
9 _setPointCache(cache => ({ ...cache, ...entry }));
17export function PointCacheProvider({ children }) {
18 const pointCache = _usePointCache();
21 <PointCacheContext.Provider value={pointCache}>
23 </PointCacheContext.Provider>
28export function usePointCache() {
29 return useContext(PointCacheContext);
33export const withPointCache = Component =>
34 forwardRef((props, ref) => (
35 <PointCacheContext.Consumer>
36 {pointCache => <Component ref={ref} {...pointCache} {...props} />}
37 </PointCacheContext.Consumer>
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