UNPKG

dreamstate

Version:

Store management library based on react context and observers

1 lines 547 B
import{DreamstateError as r}from"../core/error/DreamstateError.js";import{EDreamstateErrorCode as e}from"../types/error.js";function t(t,o){var i=!1;return{configurable:!0,get:function(){if(i)return t.value;var r=t.value.bind(this);return i=!0,Object.defineProperty(this,o,{configurable:!0,writable:!1,value:r}),i=!1,r},set:function(){throw new r(e.RESTRICTED_OPERATION,"Direct runtime modification of bound method is not allowed.")}}}function o(){return function(r,e,o){if(e&&o)return t(o,e);r.descriptor=t(r.descriptor,r.key)}}export{o as Bind};