https://github.com/nswbmw/condition-appoint
Condition Promise, based on [appoint](https://github.com/nswbmw/appoint).
https://github.com/nswbmw/condition-appoint
Last synced: 3 months ago
JSON representation
Condition Promise, based on [appoint](https://github.com/nswbmw/appoint).
- Host: GitHub
- URL: https://github.com/nswbmw/condition-appoint
- Owner: nswbmw
- Created: 2017-02-12T14:02:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-12T14:02:27.000Z (over 8 years ago)
- Last Synced: 2025-06-09T11:48:55.980Z (4 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## condition-appoint
Condition Promise, based on [appoint](https://github.com/nswbmw/appoint).
### Install
```bash
npm install condition-appoint
```### Usage
```javascript
var Promise = require('condition-appoint');
// or use the pollyfill
require('condition-appoint/polyfill');
```### Example
```javascript
var Promise = require('condition-appoint')
Promise.reject(new TypeError('type error'))
.catch(function SyntaxError(e) {
console.error('SyntaxError: ', e)
})
.catch(function TypeError(e) {
console.error('TypeError: ', e)
})
.catch(function (e) {
console.error('default: ', e)
})
// TypeError: [TypeError: type error]
``````javascript
var Promise = require('condition-appoint')
Promise.reject(new TypeError('type error'))
.catch(function SyntaxError(e) {
console.error('SyntaxError: ', e)
})
.catch(function ReferenceError(e) {
console.error('ReferenceError: ', e)
})
.catch(function (e) {
console.error('default: ', e)
})
// default: [TypeError: type error]
``````javascript
var Promise = require('condition-appoint')
Promise.reject(new TypeError('type error'))
.catch(function SyntaxError(e) {
console.error('SyntaxError: ', e)
})
.catch(function (e) {
console.error('default: ', e)
})
.catch(function TypeError(e) {
console.error('TypeError: ', e)
})
// default: [TypeError: type error]
```
### LicenseMIT