react-imported-component
Version:
I will import your component, and help to handle it
18 lines (17 loc) • 560 B
JavaScript
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();