UNPKG

react-imported-component

Version:
18 lines (17 loc) 560 B
export const createLoadableStream = () => ({ marks: {} }); export const clearStream = (stream) => { if (stream) { stream.marks = {}; } }; export const checkStream = (stream) => { if (process.env.NODE_ENV !== 'production') { if (!stream) { return; } if (typeof stream !== 'object' || !stream.marks) { throw new Error('react-imported-component: version 6 requires `stream` to be an object. Refer to the migration guide'); } } }; export const defaultStream = createLoadableStream();