@bloc-js/react-bloc
Version:
React components for implementing the BLoC pattern.
8 lines (7 loc) • 383 B
JavaScript
import * as React from "react";
import { BlocRegistry } from "./registry";
export var BlocRootContext = React.createContext(new BlocRegistry({}));
export var BlocRoot = function (_a) {
var children = _a.children, _b = _a.registry, registry = _b === void 0 ? new BlocRegistry({}) : _b;
return (React.createElement(BlocRootContext.Provider, { value: registry }, children));
};