@livelybone/singleton 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,10 @@
1
- # 1.3.0 (2023-01-29)
1
+ ## 1.3.1 (2023-01-30)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
6
  * **promiseOnPending:** Update ([32d73d6](https://github.com/livelybone/singleton/commit/32d73d62bd093446148c018cdc8cfa71dcd81e94))
7
+ * singleton.delete ([17c92ef](https://github.com/livelybone/singleton/commit/17c92ef72e0dbe3d338f96a1cd68bb2f983e2b23))
7
8
  * type bug ([7b79ee4](https://github.com/livelybone/singleton/commit/7b79ee4d3d08a7e17ac8da79de139b49b5287b01))
8
9
 
9
10
 
package/lib/es/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Bundle of @livelybone/singleton
3
- * Generated: 2023-01-29
3
+ * Generated: 2023-01-30
4
4
  * Version: 1.3.0
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
@@ -50,7 +50,7 @@ function singleton(id, defaultValue) {
50
50
  return {
51
51
  value: ids.get(k),
52
52
  delete: function _delete() {
53
- return ids.delete(id);
53
+ return ids.delete(k);
54
54
  }
55
55
  };
56
56
  }
package/lib/umd/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Bundle of @livelybone/singleton
3
- * Generated: 2023-01-29
3
+ * Generated: 2023-01-30
4
4
  * Version: 1.3.0
5
5
  * License: MIT
6
6
  * Author: 2631541504@qq.com
7
7
  */
8
8
 
9
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).Singleton={})}(this,function(e){"use strict";function c(){var e="undefined"!=typeof window?window:global;return e.$$SingletonIdsMap&&e.$$SingletonIdsMap instanceof Map||(e.$$SingletonIdsMap=new Map),e.$$SingletonIdsMap}e.onceRun=function(e,n){var t=c(),n=n?"once-run-".concat(n):e;t.has(n)||t.set(n,e())},e.promiseOnPending=function(e,n){function t(){return i.delete(a)}function o(){return void 0===u?t():setTimeout(t,u),!0}var i=c(),r=n.id,u=n.cacheTime||n.delayTime,a=r?"promise-".concat(r):e;return i.has(a)||i.set(a,e().then(function(e){return o(),e},function(e){return Promise.reject((o(),e))})),i.get(a)},e.runInterval=function(e,n){var t=c(),o="timer-".concat(e||"default"),i=(t.has(o)&&t.get(o)(),n());return t.set(o,function(){clearInterval(i),t.delete(o)}),t.get(o)},e.singleton=function(e,n){var t=c(),o="singleton-any-".concat(e||"default");return t.has(o)||t.set(o,n?n():{}),{value:t.get(o),delete:function(){return t.delete(e)}}},e.singletonObj=function(e,n){var t=c(),e="singleton-any-".concat(e||"default");return t.has(e)||t.set(e,n?n():{}),t.get(e)},Object.defineProperty(e,"__esModule",{value:!0})});
9
+ !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e=e||self).Singleton={})}(this,function(e){"use strict";function c(){var e="undefined"!=typeof window?window:global;return e.$$SingletonIdsMap&&e.$$SingletonIdsMap instanceof Map||(e.$$SingletonIdsMap=new Map),e.$$SingletonIdsMap}e.onceRun=function(e,n){var t=c(),n=n?"once-run-".concat(n):e;t.has(n)||t.set(n,e())},e.promiseOnPending=function(e,n){function t(){return i.delete(a)}function o(){return void 0===u?t():setTimeout(t,u),!0}var i=c(),r=n.id,u=n.cacheTime||n.delayTime,a=r?"promise-".concat(r):e;return i.has(a)||i.set(a,e().then(function(e){return o(),e},function(e){return Promise.reject((o(),e))})),i.get(a)},e.runInterval=function(e,n){var t=c(),o="timer-".concat(e||"default"),i=(t.has(o)&&t.get(o)(),n());return t.set(o,function(){clearInterval(i),t.delete(o)}),t.get(o)},e.singleton=function(e,n){var t=c(),o="singleton-any-".concat(e||"default");return t.has(o)||t.set(o,n?n():{}),{value:t.get(o),delete:function(){return t.delete(o)}}},e.singletonObj=function(e,n){var t=c(),e="singleton-any-".concat(e||"default");return t.has(e)||t.set(e,n?n():{}),t.get(e)},Object.defineProperty(e,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livelybone/singleton",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A util of singleton wrapping",
5
5
  "main": "./lib/umd/index.js",
6
6
  "module": "./lib/es/index.js",