UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

19 lines 772 B
import React, { createContext, useContext, useMemo } from 'react'; var SyncBlockActionsContext = /*#__PURE__*/createContext(null); export var useSyncBlockActions = function useSyncBlockActions() { return useContext(SyncBlockActionsContext); }; export var SyncBlockActionsProvider = function SyncBlockActionsProvider(_ref) { var children = _ref.children, removeSyncBlock = _ref.removeSyncBlock, fetchSyncBlockSourceInfo = _ref.fetchSyncBlockSourceInfo; var value = useMemo(function () { return { deleteSyncBlock: removeSyncBlock, fetchSourceInfo: fetchSyncBlockSourceInfo }; }, [removeSyncBlock, fetchSyncBlockSourceInfo]); return /*#__PURE__*/React.createElement(SyncBlockActionsContext.Provider, { value: value }, children); };