UNPKG

dreamstate

Version:

Store management library based on react context and observers

1 lines 464 B
import{DreamstateError as o}from"../core/error/DreamstateError.js";import{ComputedValue as r}from"../core/storing/ComputedValue.js";import{EDreamstateErrorCode as e}from"../types/error.js";import{isFunction as t,isUndefined as i}from"./typechecking.js";function n(n,m){if(t(n)&&(i(m)||t(m)))return new r(n,m);throw new o(e.INCORRECT_PARAMETER,"Computed value should be initialized with functional selector and optional memo function.")}export{n as createComputed};