dreamstate
Version:
Store management library based on react context and observers
1 lines • 721 B
JavaScript
import{shallowEqualObjects as o}from"shallow-equal";import{DreamstateError as t}from"../error/DreamstateError.js";import{ActionsStore as r}from"../storing/ActionsStore.js";import{ComputedValue as e}from"../storing/ComputedValue.js";import{NestedStore as n}from"../storing/NestedStore.js";import{EDreamstateErrorCode as s}from"../../types/error.js";import{isObject as i}from"../../utils/typechecking.js";function m(m,p){if(!i(p))throw new t(s.INCORRECT_PARAMETER,"Context should be non-nullable object, supplied '".concat(typeof p,"' type instead."));return!m||Object.keys(p).some((function(t){return!(p[t]instanceof e||p[t]instanceof r)&&(p[t]instanceof n?!o(p[t],m[t]):p[t]!==m[t])}))}export{m as shouldObserversUpdate};