@uxland/event-aggregator
Advanced tools
Comparing version 1.0.1-alpha.12 to 1.0.1-alpha.13
@@ -6,106 +6,13 @@ # Change Log | ||
## [1.0.1-alpha.12](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.11...@uxland/event-aggregator@1.0.1-alpha.12) (2021-03-12) | ||
## [1.0.1-alpha.13](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.0...@uxland/event-aggregator@1.0.1-alpha.13) (2021-05-31) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
### Bug Fixes | ||
* **event-aggregator:** esbuild approach ([31b70bf](https://github.com/uxland/uxland/commit/31b70bfcdb45d9301dc08860c11ff8de9547cdbf)) | ||
## [1.0.1-alpha.11](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.10...@uxland/event-aggregator@1.0.1-alpha.11) (2021-03-12) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.10](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.9...@uxland/event-aggregator@1.0.1-alpha.10) (2021-03-11) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.9](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.8...@uxland/event-aggregator@1.0.1-alpha.9) (2021-03-11) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.8](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.7...@uxland/event-aggregator@1.0.1-alpha.8) (2021-03-11) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.7](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.6...@uxland/event-aggregator@1.0.1-alpha.7) (2021-03-11) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.6](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.5...@uxland/event-aggregator@1.0.1-alpha.6) (2021-03-11) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.5](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.4...@uxland/event-aggregator@1.0.1-alpha.5) (2021-03-11) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.4](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.3...@uxland/event-aggregator@1.0.1-alpha.4) (2021-03-11) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.3](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.2...@uxland/event-aggregator@1.0.1-alpha.3) (2021-03-11) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.2](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.1...@uxland/event-aggregator@1.0.1-alpha.2) (2021-03-10) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.1](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.1-alpha.0...@uxland/event-aggregator@1.0.1-alpha.1) (2021-03-10) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
## [1.0.1-alpha.0](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.0...@uxland/event-aggregator@1.0.1-alpha.0) (2021-03-10) | ||
**Note:** Version bump only for package @uxland/event-aggregator | ||
# [1.0.0](https://github.com/uxland/uxland/compare/@uxland/event-aggregator@1.0.0-alpha.19...@uxland/event-aggregator@1.0.0) (2021-03-09) | ||
@@ -112,0 +19,0 @@ |
@@ -1,1 +0,17 @@ | ||
let l=1;l=1,l=1;class c{constructor(e,t){this.messageType=e,this.callback=t}handle(e){e instanceof this.messageType&&this.callback.call(null,e)}}const b=(r,e,t)=>{try{r(e,t)}catch(s){console.error(s)}},p=(r,e)=>{try{r.handle(e)}catch(t){console.error(t)}};class o{constructor(){this.eventLookup={},this.messageHandlers=[]}publish(e,t){let s,n;if(!e)throw new Error("Event channel/type is invalid.");if(typeof e=="string"){if(s=this.eventLookup[e],s)for(s=s.slice(),n=s.length;n--;)b(s[n],t,e)}else for(s=this.messageHandlers.slice(),n=s.length;n--;)p(s[n],e)}subscribe(e,t){let s,n;if(!e)throw new Error("Event channel/type is invalid.");return typeof e=="string"?(s=t,n=this.eventLookup[e]||(this.eventLookup[e]=[])):(s=new c(e,t),n=this.messageHandlers),n.push(s),{dispose(){const a=n.indexOf(s);a!==-1&&n.splice(a,1)}}}subscribeOnce(e,t){const s=this.subscribe(e,(n,a)=>(s.dispose(),t(n,a)));return s}}const i=new o,d=i.subscribe.bind(i),h=i.subscribeOnce.bind(i),u=i.publish.bind(i);export{o as EventAggregator,i as eventAggregator,u as publish,d as subscribe,h as subscribeOnce}; | ||
/* | ||
* @license | ||
* BSD License | ||
* | ||
* Copyright (c) 2020, UXLand | ||
* | ||
* All rights reserved. | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the <copyright holder>. | ||
* 4. Neither the name of the <copyright holder> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/let l=1;l=1,l=1;class o{constructor(e,t){this.messageType=e,this.callback=t}handle(e){e instanceof this.messageType&&this.callback.call(null,e)}}const c=(r,e,t)=>{try{r(e,t)}catch(s){console.error(s)}},b=(r,e)=>{try{r.handle(e)}catch(t){console.error(t)}};class p{constructor(){this.eventLookup={},this.messageHandlers=[]}publish(e,t){let s,n;if(!e)throw new Error("Event channel/type is invalid.");if(typeof e=="string"){if(s=this.eventLookup[e],s)for(s=s.slice(),n=s.length;n--;)c(s[n],t,e)}else for(s=this.messageHandlers.slice(),n=s.length;n--;)b(s[n],e)}subscribe(e,t){let s,n;if(!e)throw new Error("Event channel/type is invalid.");return typeof e=="string"?(s=t,n=this.eventLookup[e]||(this.eventLookup[e]=[])):(s=new o(e,t),n=this.messageHandlers),n.push(s),{dispose(){const a=n.indexOf(s);a!==-1&&n.splice(a,1)}}}subscribeOnce(e,t){const s=this.subscribe(e,(n,a)=>(s.dispose(),t(n,a)));return s}}const i=new p,d=i.subscribe.bind(i),h=i.subscribeOnce.bind(i),u=i.publish.bind(i);export{p as EventAggregator,i as eventAggregator,u as publish,d as subscribe,h as subscribeOnce}; |
@@ -17,2 +17,2 @@ /* | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/export*from"./event-aggregator";console.log("@uxland/event-aggregator loaded"); | ||
*/export*from"./event-aggregator"; |
{ | ||
"name": "@uxland/event-aggregator", | ||
"version": "1.0.1-alpha.12", | ||
"version": "1.0.1-alpha.13", | ||
"description": "Event Aggregator", | ||
@@ -10,12 +10,10 @@ "author": "UXLand <dev@uxland.es>", | ||
"module": "index.js", | ||
"types": "src/index.d.ts", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"README.md", | ||
"package.json", | ||
"**/*.js", | ||
"**/*.d.ts", | ||
"**/*.js", | ||
"!*.config.js", | ||
"!coverage/*", | ||
"lib", | ||
"dist", | ||
"README.md", | ||
"package.json" | ||
"!coverage/**/*" | ||
], | ||
@@ -31,10 +29,9 @@ "publishConfig": { | ||
"scripts": { | ||
"build:es": "tsc -p tsconfig.json --outDir es --module esnext --target es2018 --noEmit false", | ||
"build:cjs": "tsc -p tsconfig.json --outDir lib --target es2018 --noEmit false --declaration --removeComments false", | ||
"build:umd": "cross-env NODE_ENV=development rollup -c -o dist/index.js", | ||
"build:umd:min": "cross-env NODE_ENV=production rollup -c -o dist/index.min.js", | ||
"build:clean": "rimraf es lib dist tmp tsconfig.tsbuildinfo", | ||
"build": "yarn build:clean && npm-run-all --parallel build:es build:cjs && npm-run-all --parallel build:umd build:umd:min", | ||
"preesbuild": "echo nok > .buildstatus", | ||
"postesbuild": "echo ok > .buildstatus", | ||
"build:dts": "tsc --emitDeclarationOnly --noEmit false --declaration --removeComments false --outDir .", | ||
"build:clean": "rimraf {index,event-aggregator}.{!config.js,js,d.ts} tsconfig.tsbuildinfo", | ||
"build:cjs": "esbuild index.ts --bundle --minify --target=es2018 --outfile=lib/index.js", | ||
"build:es": "esbuild *.ts --minify --format=esm --outdir=.", | ||
"build": "npm-run-all --parallel build:es build:dts", | ||
"prebuild": "echo nok > .buildstatus", | ||
"postbuild": "echo ok > .buildstatus", | ||
"readme:coverage": "node_modules/.bin/jest-badges-readme", | ||
@@ -50,7 +47,3 @@ "tdd": "jest --watch --collect-coverage", | ||
"jsdoc:mv": "mkdirp ../../docs/$npm_package_name/$npm_package_version && ncp docs/$npm_package_name/$npm_package_version ../../docs/$npm_package_name/$npm_package_version", | ||
"postjsdoc": "yarn jsdoc:styles && yarn jsdoc:mv", | ||
"esbuild:dts": "tsc --emitDeclarationOnly --noEmit false --declaration --removeComments false", | ||
"esbuild:cjs": "esbuild src/index.ts --bundle --minify --target=es2018 --outfile=lib/index.js", | ||
"esbuild:es": "esbuild *.ts --minify --format=esm --outdir=.", | ||
"esbuild": "npm-run-all --parallel esbuild:es esbuild:dts" | ||
"postjsdoc": "yarn jsdoc:styles && yarn jsdoc:mv" | ||
}, | ||
@@ -70,3 +63,3 @@ "bugs": { | ||
"cucumber": "^6.0.5", | ||
"esbuild": "^0.9.0", | ||
"esbuild": "^0.11.20", | ||
"jest": "^26.4.2", | ||
@@ -87,3 +80,3 @@ "jest-cucumber": "^3.0.0", | ||
}, | ||
"gitHead": "64f9f38b8240914967251c2e83372cffea9ecc20" | ||
"gitHead": "edf192cc31732dc02df22c595faca76354acc0f7" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
179
22159