1.0.0 • Published 7 years ago

condition-appoint v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

condition-appoint

Condition Promise, based on appoint.

Install

npm install condition-appoint

Usage

var Promise = require('condition-appoint');
// or use the pollyfill
require('condition-appoint/polyfill');

Example

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]
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]
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]

License

MIT