import React, { createContext, forwardRef, useContext } from 'react';
import usePointStore from './lib/usePointStore';
export const PointCacheContext = createContext(null);
export function PointCacheProvider({ children }) {
const cache = usePointStore();
return (
{children}
);
}
// Hook version
export function usePointCache() {
return useContext(PointCacheContext);
}
// HOC version
export const withPointCache = Component =>
forwardRef((props, ref) => (
{cache => }
));