import React, { FC, useState, useEffect } from 'react'; import { TippleContext } from './context'; import { TippleClient, TippleCache } from './client'; /** Provider for using tipple. */ export const Provider: FC<{ client: TippleClient }> = ({ client, children, }) => { const [cache, setCache] = useState( client.config.initialCache || {} ); useEffect(() => client.addCacheWatcher(setCache), [client]); return ( {children} ); }; Provider.displayName = 'TippleProvider';