recoil
Version:
Recoil - A state management library for React
40 lines (33 loc) • 1.49 kB
Flow
/**
* 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.
*
* @emails oncall+recoil
* @flow strict
* @format
*/
;
import type { DependencyMap, Graph } from './Recoil_GraphTypes';
import type { NodeKey, Version } from './Recoil_Keys';
import type { Store } from './Recoil_State';
const differenceSets = require('../util/Recoil_differenceSets');
const mapMap = require('../util/Recoil_mapMap');
const nullthrows = require('../util/Recoil_nullthrows');
const recoverableViolation = require('../util/Recoil_recoverableViolation');
export type { DependencyMap, Graph } from './Recoil_GraphTypes';
declare function graph(): Graph;
declare function cloneGraph(graph: Graph): Graph; // Note that this overwrites the deps of existing nodes, rather than unioning
// the new deps with the old deps.
declare function mergeDependencyMapIntoGraph(deps: DependencyMap, graph: Graph, olderGraph?: Graph): void;
declare function saveDependencyMapToStore(dependencyMap: DependencyMap, store: Store, version: Version): void;
declare function mergeDepsIntoDependencyMap(from: DependencyMap, into: DependencyMap): void;
declare function addToDependencyMap(downstream: NodeKey, upstream: NodeKey, dependencyMap: DependencyMap): void;
module.exports = {
addToDependencyMap,
cloneGraph,
graph,
mergeDepsIntoDependencyMap,
saveDependencyMapToStore
};