{"size": 688, "ext": "js", "max_stars_repo_path": "fixtures/blocks/src/lib/cache.js", "max_stars_repo_name": "fredatcoffeewerkz/react", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "fixtures/blocks/src/lib/cache.js", "max_issues_repo_name": "fredatcoffeewerkz/react", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "fixtures/blocks/src/lib/cache.js", "max_forks_repo_name": "fredatcoffeewerkz/react", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.1935483871, "max_line_length": 66, "alphanum_fraction": 0.7238372093}
/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import {createContext} from 'react';

// TODO: clean up and move to react/cache.

// TODO: cancellation token.

// TODO: does there need to be default context?

const CacheContext = createContext(null);

export const CacheProvider = CacheContext.Provider;

// TODO: use this for invalidation.

export function createCache() {
  return new Map();
}

export function readCache() {
  // TODO: this doesn't subscribe.
  // But we really want load context anyway.
  return CacheContext._currentValue;
}
