Type/to search

仿Promise异步模板

Template
Created: 2022-10-15 22:42:50
Last modified: 4 years ago
0
Follow
1
Followers

仿Promise异步模板

也没什么好说的,使用方法和Promise类似。

Source
JavaScript

class Task {
    static PENDING = 'pending'
    static FULFILLED = 'fulFilled'
    static REJECTED = 'rejected'
    static WaitResults = []

    constructor(executor) {
        this.status = Task.PENDING
        this.value = undefined
        this.reason = undefined
        this.onResolvedCallbacks = []
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)