'use client';
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import React, { createContext, use, useState } from 'react';
const Context = /*#__PURE__*/ createContext({
    mostRecentUpdate: null,
    reportUpdate: ()=>null
});
export const DocumentEventsProvider = ({ children })=>{
    const [mostRecentUpdate, reportUpdate] = useState(null);
    return /*#__PURE__*/ _jsxDEV(Context, {
        value: {
            mostRecentUpdate,
            reportUpdate
        },
        children: children
    }, void 0, false, {
        fileName: "src/providers/DocumentEvents/index.tsx",
        lineNumber: 17,
        columnNumber: 10
    }, this);
};
/**
 * The useDocumentEvents hook provides a way of subscribing to cross-document events,
 * such as updates made to nested documents within a drawer.
 * This hook will report document events that are outside the scope of the document currently being edited.
 *
 * @link https://payloadcms.com/docs/admin/react-hooks#usedocumentevents
 */ export const useDocumentEvents = ()=>use(Context);

//# sourceMappingURL=index.js.map