observevent
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -1,6 +0,2 @@ | ||
export * from './derives'; | ||
export * from './observify'; | ||
export * from './subjectify'; | ||
export * from './types'; | ||
export * from './models'; | ||
//# sourceMappingURL=index.js.map | ||
function n(n,r){var u,t,e,i;void 0===r&&(r={});var f=function(n){return new Proxy(n,{set:function(n,r,u){return function(n){l.forEach(function(r){return r(n)})}(o?[u,n[r]]:u),s&&c.info({before:n[r],after:u}),n[r]=u,!0}})}({value:n}),o=null!=(u=r.diff)&&u,c=null!=(t=r.logger)?t:console,s=null!=(e=r.logging)&&e,b=null==(i=r.immediate)||i,l=[];return{get subscribed(){return l.length>0},get diff(){var n;return null!=(n=r.diff)&&n},notify:function(n){var r="function"==typeof n?n(f.value):n;f.value=r},subscribe:function(n){return b&&n(o?[f.value,void 0]:f.value),l.push(n),function(){l=l.filter(function(r){return r!==n})}}}}function r(r,u){void 0===u&&(u={});var t=[];t.length=r.length;var e=n(t,u),i=[];return r.forEach(function(n,r){i.push(n.subscribe(function(n){t[r]=n,e.notify([].concat(t))}))}),{subscribe:function(n){return e.subscribe(n),function(){i.forEach(function(n){return n()})}},get diff(){var n;return null!=(n=u.diff)&&n}}}function u(n,r){return{subscribe:function(u){return n.subscribe(function(n){return u(r(n))})},get diff(){return n.diff}}}exports.combine=r,exports.combineMap=function(n,t,e){return void 0===e&&(e={}),u(r(n,e),t)},exports.exclude=function(n,r){var u;return{subscribe:function(t){return n.subscribe(function(e){r(e)||(t(n.diff?[e[0],u]:e),u=e[0])})},get diff(){return n.diff}}},exports.map=u,exports.observify=function(r,u,t){void 0===t&&(t={});var e=n(r,t),i=u(e.notify);return{subscribe:function(n){var r=e.subscribe(n);return function(){r(),e.subscribed||"function"!=typeof i||i()}},get diff(){var n;return null!=(n=t.diff)&&n}}},exports.select=function(n,r){var u;return{subscribe:function(t){return n.subscribe(function(e){r(e)&&(t(n.diff?[e[0],u]:e),u=e[0])})},get diff(){return n.diff}}},exports.subjectify=n; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "observevent", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "observe event", | ||
"homepage": "https://github.com/koheing/observevent", | ||
"bugs": "https://github.com/koheing/observevent/issues", | ||
"type": "module", | ||
"types": "lib/index.d.ts", | ||
@@ -13,3 +12,2 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "vitest", | ||
@@ -16,0 +14,0 @@ "coverage": "vitest run --coverage", |
{ | ||
"compilerOptions": { | ||
"module": "esnext", | ||
"module": "CommonJS", | ||
"target": "ESNext", | ||
@@ -12,3 +12,2 @@ "isolatedModules": true, | ||
"sourceMap": true, | ||
"moduleResolution": "node", | ||
"outDir": "./lib" | ||
@@ -15,0 +14,0 @@ }, |
Sorry, the diff of this file is not supported yet
41908
19
241
No