dreamstate
Version:
Store management library based on react context and observers
1 lines • 709 B
JavaScript
import{DreamstateError as r}from"../error/DreamstateError.js";import{ContextManager as o}from"../management/ContextManager.js";import{createCombinedProvider as e}from"./combined/createCombinedProvider.js";import{createScopedProvider as t}from"./scoped/createScopedProvider.js";import{EDreamstateErrorCode as n}from"../../types/error.js";function a(a,i){if(void 0===i&&(i={}),!Array.isArray(a)||!a.length)throw new r(n.INCORRECT_PARAMETER,"Only array of context managers is acceptable.");for(var m=0;m<a.length;m++)if(!(a[m]&&a[m].prototype instanceof o))throw new r(n.TARGET_CONTEXT_MANAGER_EXPECTED,"'".concat(String(a[m]),"' is in sources array."));return i.isCombined?e(a):t(a)}export{a as createProvider};