diff --git a/dist/index.js b/dist/index.js index 1443cf9..bfc03ee 100644 --- a/dist/index.js +++ b/dist/index.js @@ -25,9 +25,10 @@ function newRidgeState(initialValue, options) { const pv = v; v = newValue instanceof Function ? newValue(v) : newValue; setTimeout(() => { + var _a; sb.forEach((c) => c(v, pv)); - callback?.(v, pv); - options?.onSet?.(v, pv); + callback === null || callback === void 0 ? void 0 : callback(v, pv); + (_a = options === null || options === void 0 ? void 0 : options.onSet) === null || _a === void 0 ? void 0 : _a.call(options, v, pv); }); } function subscribe(subscriber) { diff --git a/package.json b/package.json index f5970bd..6fa8fd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-ridge-state", - "version": "4.2.7", + "version": "4.2.8", "description": "react-ridge-state is a very simple global state management library for React and React Native", "type": "module", "main": "dist/index.js", diff --git a/tsconfig.json b/tsconfig.json index 312e669..426b312 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "target": "esnext", + "target": "es6", "declaration": true, "outDir": "./dist", "removeComments": true,