4VTQFOTF "1*XJMMCFDIBOHFE
import SimpleCacheProvider from ‘simple-cache-provider’;
const cache = SimpleCacheProvider.createCache();
const userFetcher = id => SimpleCacheProvider.createResource(id =>
fetch(`/api/users/${id}`).then(res => res.json());
)(cache, id);
const User = props => {
const user = userFetcher.read(props.id);
return
{user.name}
;
};
const Placeholder = props => (
{didExpire => didExpire ? props.fallback : props.children}
);