@dr.pogodin/react-utils
Version:
Collection of generic ReactJS components and utils
9 lines • 1.32 kB
JavaScript
import clientModule from"./client/index.js";import{webpack}from"./shared/utils/index.js";// It is a safeguard against multiple instances / versions of the library
// being loaded into environment by mistake (e.g. because of different
// packages pinning down different exact versions of the lib, thus preventing
// a proper dedupe and using a single common library version).
if(global.REACT_UTILS_LIBRARY_LOADED){throw Error("React utils library is already loaded")}else global.REACT_UTILS_LIBRARY_LOADED=true;// TODO: This is a rapid workaround to get rid of __dirname. I guess, later
// we'll re-implement requireWeak() to accept import.meta.url directly, and
// this workaround won't be needed.
let dirname=import.meta.url;dirname=dirname.slice(5,dirname.lastIndexOf("/"));const server=webpack.requireWeak("./server",dirname);const client=server?undefined:clientModule;export{getGlobalState,GlobalStateProvider,newAsyncDataEnvelope,useAsyncCollection,useAsyncData,useGlobalState,withGlobalStateType}from"@dr.pogodin/react-global-state";export*from"./shared/components/index.js";export{assertEmptyObject,config,Barrier,Cached,Emitter,isomorphy,getSsrContext,Semaphore,splitComponent,themed,ThemeProvider,time,webpack,withRetries}from"./shared/utils/index.js";export{client,server};
//# sourceMappingURL=index.js.map