How to use the react-cache.createCache function in react-cache

To help you get started, we’ve selected a few react-cache examples, based on popular ways it is used in public projects.

github topheman / react-fiber-experiments / src / cache.js View on Github external
export function initCache() {
  // `createCache` accepts an invalidator function in first argument: https://github.com/facebook/react/blob/master/packages/react-cache/src/ReactCache.js#L152
  cache = createCache(initCache);
}
github facebook / react / fixtures / unstable-async / suspense / src / cache.js View on Github external
function initCache() {
  cache = createCache(initCache);
}
initCache();
github Raathigesh / hooks.guide / src / preview.js View on Github external
import ReactDOM from "react-dom";
import styled from "styled-components";
import { Helmet } from "react-helmet";
import throttle from "lodash.throttle";
import { createCache, createResource } from "react-cache";
import { execute } from "./utils/executor";
import { fetchDoc } from "./utils/fetcher";
import { parse } from "./utils/md-parser";
import Editor from "./editor";
import Contributors from "./contributors";
import TabFrame from "./tab-frame";
import { highlightColor } from "./theme";
import LogoComp from "./logo";

window.React = React;
const cache = createCache();
const docsResource = createResource(fetchDoc);

const Container = styled.div`
  max-width: 900px;
  flex-direction: column;
  flex: 1 1 auto;
  padding-left: 70px;
  @media (max-width: 700px) {
    padding-left: 10px;
  }
`;

const Name = styled.div`
  font-size: 30px;
  font-weight: 400;
`;

react-cache

A basic cache for React applications

MIT
Latest version published 4 years ago

Package Health Score

75 / 100
Full package analysis

Similar packages