File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ Thanks to [this pull request](https://github.com/GianlucaGuarini/allora/pull/3)
5050const myWindow = allora (window )
5151const timer = myWindow .setTimeout (3000 )
5252timer .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
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments