1.3.2 • Published 3 years ago

promise-super v1.3.2

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

Promise Super

Syntactic Sugar Imitation -- Self Entertainment

const promiseSuper = require('promise-super')
const promise = new promiseSuper(

	( resolve, reject ) => {

		if ( false )
		{
			reject('error')
		}
		else
		{
			resolve('success')
		}
	}

)
promise
	.then(
		( data ) => {
			console.log( data ); // success
			return `message ${data}` // will pass on next then
		}
	)
	.catch(
		( error ) => {
			console.log( error ) // error
		}
	)
	.finally(
		( data ) => {
			console.log( data ) // data is latest then return
		}
	)
promise.next(
	( data ) => {
		console.log( data ) // next run
	}
)
promise.then(
	( data, next ) => {
		next('next run')
	}
)
1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

4 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago