Skip to content

Commit c5dc101

Browse files
updated: doc and first stable release
1 parent a26ffb4 commit c5dc101

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ Thanks to [this pull request](https://github.com/GianlucaGuarini/allora/pull/3)
5050
const myWindow = allora(window)
5151
const timer = myWindow.setTimeout(3000)
5252
timer.then(_ => console.log('time over'))
53-
clearTimeout(timer)
53+
// the valueOf call should be not needed here
54+
// but if you are on node, you will need it https://github.com/nodejs/node/issues/7792
55+
clearTimeout(timer.valueOf())
5456
```
5557

5658
## "allora" meaning

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function isOnCallback (str) {
99
* @param { String } prop - property we are trying to get from the parent object
1010
* @returns { Proxy }
1111
*/
12-
function makePromisable (parent, prop) {
12+
function allora (parent, prop) {
1313
return new Proxy(prop ? parent[prop] : parent, {
1414
get: (target, property) => {
1515
// no function no need for promises in return
@@ -23,7 +23,7 @@ function makePromisable (parent, prop) {
2323
return target[property]
2424
} else {
2525
// make proxy also the nested object properties
26-
return makePromisable(target, property)
26+
return allora(target, property)
2727
}
2828
},
2929
// this is cool to make promiseable event emitters
@@ -45,4 +45,4 @@ function makePromisable (parent, prop) {
4545
})
4646
}
4747

48-
module.exports = exports.default = (object) => makePromisable(object)
48+
module.exports = exports.default = (object) => allora(object)

0 commit comments

Comments
 (0)