mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
record io
This commit is contained in:
33
record_io/promise.js
Normal file
33
record_io/promise.js
Normal file
@@ -0,0 +1,33 @@
|
||||
//let value = Promise.reject(1)
|
||||
|
||||
/*
|
||||
value.then(
|
||||
() => console.log('res'),
|
||||
() => console.log('rej'),
|
||||
)
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
const original_value = value
|
||||
|
||||
value = new Promise((resolve, reject) => {
|
||||
globalThis.setTimeout(
|
||||
() => {
|
||||
console.log('timeout')
|
||||
original_value.then(resolve, reject)
|
||||
},
|
||||
1000
|
||||
)
|
||||
})
|
||||
|
||||
try {
|
||||
console.log(await value)
|
||||
} catch(e) {
|
||||
console.log('ERROR', e)
|
||||
}
|
||||
*/
|
||||
|
||||
const t = globalThis.setTimeout
|
||||
|
||||
t(() => console.log('timeout'), 100)
|
||||
Reference in New Issue
Block a user