typed-signals
Advanced tools
Comparing version 1.0.5 to 2.0.0
{ | ||
"name": "typed-signals", | ||
"version": "1.0.5", | ||
"version": "2.0.0", | ||
"description": "A type checked signal library for TypeScript (and JavaScript)", | ||
@@ -12,4 +12,2 @@ "keywords": [ | ||
], | ||
"author": "Santo Pfingsten", | ||
"license": "CC0-1.0", | ||
"homepage": "https://github.com/Lusito/typed-signals", | ||
@@ -23,45 +21,38 @@ "bugs": { | ||
}, | ||
"license": "CC0-1.0", | ||
"author": "Santo Pfingsten", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist/src", | ||
"src/", | ||
"tsconfig.json" | ||
"dist" | ||
], | ||
"main": "dist/src/Signal.js", | ||
"types": "dist/src/Signal.d.ts", | ||
"scripts": { | ||
"pretest": "tsc", | ||
"test": "nyc mocha --require source-map-support/register \"./dist/test/**/*.js\"", | ||
"build": "rimraf dist && tsc -p tsconfig-build.json", | ||
"coveralls": "cat ./coverage/lcov.info | coveralls", | ||
"doc": "typedoc --out docs --excludeNotExported src" | ||
"doc": "rimraf docs && typedoc --excludePrivate --out docs --excludeNotExported --exclude src/*.spec.ts src && copyfiles -a -f doc-assets/* docs", | ||
"lint": "npm run lint:style && npm run lint:es && npm run lint:package", | ||
"lint:es": "eslint {src,test}/**/*.{ts,tsx} --ext .ts,.tsx --ignore-path .prettierignore", | ||
"lint:es:fix": "npm run lint:es -- --fix", | ||
"lint:fix": "npm run lint:style:fix && npm run lint:es:fix && npm run lint:package:fix", | ||
"lint:package": "sort-package-json --check", | ||
"lint:package:fix": "sort-package-json", | ||
"lint:style": "npm run lint:style:base -- --check", | ||
"lint:style:base": "prettier {src,test}/**/*.{ts,tsx,js,json} ./*.{ts,tsx,js,json}", | ||
"lint:style:fix": "npm run lint:style:base -- --write", | ||
"test": "jest" | ||
}, | ||
"nyc": { | ||
"extension": [ | ||
".ts", | ||
".tsx" | ||
], | ||
"exclude": [ | ||
"coverage/**/*", | ||
"test/**/*", | ||
"dist/test/**/*", | ||
"docs/**/*", | ||
"**/*.d.ts" | ||
], | ||
"reporter": [ | ||
"lcov" | ||
], | ||
"all": true | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.1.7", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.12.1", | ||
"awesome-typescript-loader": "^5.2.1", | ||
"chai": "^4.2.0", | ||
"coveralls": "^3.0.2", | ||
"mocha": "^5.2.0", | ||
"nyc": "^13.1.0", | ||
"source-map-loader": "^0.2.4", | ||
"source-map-support": "^0.5.9", | ||
"typescript": "^3.1.5" | ||
"@lusito/eslint-config": "^1.0.4", | ||
"@lusito/prettier-config": "^1.0.0", | ||
"@lusito/stylelint-config": "^1.0.0", | ||
"@types/jest": "^25.1.5", | ||
"copyfiles": "^2.2.0", | ||
"coveralls": "^3.0.11", | ||
"jest": "^25.2.6", | ||
"rimraf": "^3.0.2", | ||
"sort-package-json": "^1.40.0", | ||
"ts-jest": "^25.3.0", | ||
"typedoc": "^0.17.3", | ||
"typescript": "^3.8.3" | ||
} | ||
} |
![](https://lusito.github.io/typed-signals/typed_signals.png) | ||
[![License](https://img.shields.io/badge/License-CC0%20Public%20Domain-blue.svg)](http://creativecommons.org/publicdomain/zero/1.0/) | ||
[![Minified + gzipped size](https://badgen.net/bundlephobia/minzip/typed-signals)](https://www.npmjs.com/package/typed-signals) | ||
[![NPM version](https://badgen.net/npm/v/typed-signals)](https://www.npmjs.com/package/typed-signals) | ||
[![License](https://badgen.net/github/license/lusito/typed-signals)](https://github.com/lusito/typed-signals/blob/master/LICENSE) | ||
[![Stars](https://badgen.net/github/stars/lusito/typed-signals)](https://github.com/lusito/typed-signals) | ||
[![Watchers](https://badgen.net/github/watchers/lusito/typed-signals)](https://github.com/lusito/typed-signals) | ||
@@ -13,4 +17,7 @@ |Master|[![Build Status](https://travis-ci.org/Lusito/typed-signals.svg?branch=master)](https://travis-ci.org/Lusito/typed-signals)|[![Code Coverage](https://coveralls.io/repos/github/Lusito/typed-signals/badge.svg?branch=master)](https://coveralls.io/github/Lusito/typed-signals)| | ||
The original unit tests and additional ones are running automatically on | ||
The original unit tests and additional ones are running automatically on [Travis-CI](https://travis-ci.org/) | ||
#### Fair Warning | ||
With version 2, the target is now es2015, so if you want to support older browser, you'll have to ensure that this module is being transpiled to an older es version during your build-process. | ||
### Why Typed-Signals? | ||
@@ -98,12 +105,12 @@ | ||
Built-in Collectors: | ||
- `CollectorLast<CB extends Function, RT>` | ||
- `CollectorLast<THandler extends (...args: any[]) => any>` | ||
- Returns the result of the last signal handler from a signal emission. | ||
- `CollectorUntil0<CB extends Function>` | ||
- `CollectorUntil0<THandler extends (...args: any[]) => boolean>` | ||
- Keep signal emissions going while all handlers return true. | ||
- `CollectorWhile0<CB extends Function>` | ||
- `CollectorWhile0<THandler extends (...args: any[]) => boolean>` | ||
- Keep signal emissions going while all handlers return false. | ||
- `CollectorArray<CB extends Function, RT>` | ||
- `CollectorArray<THandler extends (...args: any[]) => any>` | ||
- Returns the result of the all signal handlers from a signal emission in an array. | ||
`CB` must be the same function signature as the signal, `RT` must be the return type of the signal. Here is an example: | ||
`THandler` must be the same function signature as the signal. Here is an example: | ||
@@ -114,3 +121,3 @@ ```typescript | ||
let mySignal = new Signal<() => string>(); | ||
let collector = new CollectorLast<() => string, string>(mySignal); | ||
let collector = new CollectorLast<() => string>(mySignal); | ||
mySignal.connect(()=> 'Hello World'); | ||
@@ -117,0 +124,0 @@ mySignal.connect(()=> 'Foo Bar'); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
23
138
32437
12
549
1