1import React, { createContext, forwardRef, useContext } from 'react';
3import useDeepEqualReference from 'lib/useDeepEqualReference';
4import usePointStore from './lib/usePointStore';
6export const PointCacheContext = createContext(null);
8export function PointCacheProvider({ children }) {
9 const cache = usePointStore();
12 <PointCacheContext.Provider value={useDeepEqualReference(cache)}>
14 </PointCacheContext.Provider>
19export function usePointCache() {
20 return useContext(PointCacheContext);
24export const withPointCache = Component =>
25 forwardRef((props, ref) => (
26 <PointCacheContext.Consumer>
27 {cache => <Component ref={ref} {...cache} {...props} />}
28 </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