Comparing version 0.7.3 to 0.7.4
/* | ||
Yaku v0.7.3 | ||
Yaku v0.7.4 | ||
(c) 2015 Yad Smood. http://ysmood.org | ||
@@ -14,2 +14,3 @@ License MIT | ||
* that you can easily map, filter and debounce events in a promise way. | ||
* For real world example: [Double Click Demo](https://jsfiddle.net/ysmood/musds0sv/). | ||
* @param {Function} executor `(emit) ->` It's optional. | ||
@@ -20,9 +21,9 @@ * @return {Function} `(onEmit, onError) ->` The fucntion's | ||
* { | ||
* emit: (value) => { \/* ... *\/ }, | ||
* emit: (value) => { \/* ... *\/ }, | ||
* | ||
* // Get current value from it. | ||
* value: Promise, | ||
* // Get current value from it. | ||
* value: Promise, | ||
* | ||
* // All the children spawned from current source. | ||
* children: Array | ||
* // All the children spawned from current source. | ||
* children: Array | ||
* } | ||
@@ -37,3 +38,3 @@ * ``` | ||
* setInterval(() => { | ||
* linear.emit(x++); | ||
* linear.emit(x++); | ||
* }, 1000); | ||
@@ -69,3 +70,3 @@ * | ||
* var keyup = source((emit) => { | ||
* document.querySelector('input').onkeyup = emit; | ||
* document.querySelector('input').onkeyup = emit; | ||
* }); | ||
@@ -72,0 +73,0 @@ * |
/* | ||
Yaku v0.7.3 | ||
Yaku v0.7.4 | ||
(c) 2015 Yad Smood. http://ysmood.org | ||
@@ -4,0 +4,0 @@ License MIT |
/* | ||
Yaku v0.7.3 | ||
Yaku v0.7.4 | ||
(c) 2015 Yad Smood. http://ysmood.org | ||
@@ -158,3 +158,6 @@ License MIT | ||
Yaku.resolve = function (val) { | ||
return val instanceof Yaku ? val : settleWithX(newEmptyYaku(), val); | ||
if (val instanceof Yaku) | ||
return val; | ||
else | ||
return settleWithX(newEmptyYaku(), val); | ||
}; | ||
@@ -161,0 +164,0 @@ |
{ | ||
"name": "yaku", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "An ES6 Promises/A+ implementation that doesn't hurt.", | ||
@@ -5,0 +5,0 @@ "main": "lib/yaku.js", |
@@ -232,3 +232,3 @@ <a href="http://promisesaplus.com/"> | ||
- ### **[Yaku.reject(reason)](src/yaku.js?source#L166)** | ||
- ### **[Yaku.reject(reason)](src/yaku.js?source#L169)** | ||
@@ -250,3 +250,3 @@ The `Promise.reject(reason)` method returns a Promise object that is rejected with the given reason. | ||
- ### **[Yaku.race(iterable)](src/yaku.js?source#L190)** | ||
- ### **[Yaku.race(iterable)](src/yaku.js?source#L193)** | ||
@@ -280,3 +280,3 @@ The `Promise.race(iterable)` method returns a promise that resolves or rejects | ||
- ### **[Yaku.all(iterable)](src/yaku.js?source#L229)** | ||
- ### **[Yaku.all(iterable)](src/yaku.js?source#L232)** | ||
@@ -311,3 +311,3 @@ The `Promise.all(iterable)` method returns a promise that resolves when | ||
- ### **[Yaku.onUnhandledRejection(reason, p)](src/yaku.js?source#L278)** | ||
- ### **[Yaku.onUnhandledRejection(reason, p)](src/yaku.js?source#L281)** | ||
@@ -341,3 +341,3 @@ Catch all possibly unhandled rejections. If you want to use specific | ||
- ### **[Yaku.enableLongStackTrace](src/yaku.js?source#L297)** | ||
- ### **[Yaku.enableLongStackTrace](src/yaku.js?source#L300)** | ||
@@ -357,3 +357,3 @@ It is used to enable the long stack trace. | ||
- ### **[Yaku.nextTick](src/yaku.js?source#L320)** | ||
- ### **[Yaku.nextTick](src/yaku.js?source#L323)** | ||
@@ -631,3 +631,3 @@ Only Node has `process.nextTick` function. For browser there are | ||
- ### **[source(executor)](src/source.js?source#L82)** | ||
- ### **[source(executor)](src/source.js?source#L83)** | ||
@@ -637,2 +637,3 @@ Create a composable event source function. | ||
that you can easily map, filter and debounce events in a promise way. | ||
For real world example: [Double Click Demo](https://jsfiddle.net/ysmood/musds0sv/). | ||
@@ -649,9 +650,9 @@ - **<u>param</u>**: `executor` { _Function_ } | ||
{ | ||
emit: (value) => { /* ... */ }, | ||
emit: (value) => { /* ... */ }, | ||
// Get current value from it. | ||
value: Promise, | ||
// Get current value from it. | ||
value: Promise, | ||
// All the children spawned from current source. | ||
children: Array | ||
// All the children spawned from current source. | ||
children: Array | ||
} | ||
@@ -668,3 +669,3 @@ ``` | ||
setInterval(() => { | ||
linear.emit(x++); | ||
linear.emit(x++); | ||
}, 1000); | ||
@@ -702,3 +703,3 @@ | ||
var keyup = source((emit) => { | ||
document.querySelector('input').onkeyup = emit; | ||
document.querySelector('input').onkeyup = emit; | ||
}); | ||
@@ -705,0 +706,0 @@ |
60096
1175
750