one-time-execution-method:定义只执行一次的方法

时间:2021-04-07 17:12:46
【文件属性】:
文件名称:one-time-execution-method:定义只执行一次的方法
文件大小:10KB
文件格式:ZIP
更新时间:2021-04-07 17:12:46
JavaScript 一次性执行方法 定义仅执行一次的方法。 对于异步功能,将产生第一个承诺。 调用将被保留,并在将来始终交付 例子 import { replaceWithOneTimeExecutionMethod } from "one-time-execution-method" ; class MyClass { constructor ( ) { this . executions = 0 ; } initialize ( ) { this . executions ++ ; return new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ; } } // replace initialize() method of MyClass to be executed only once replac
【文件预览】:
one-time-execution-method-master
----.gitignore(60B)
----README.md(4KB)
----.github()
--------workflows()
--------dependabot.yml(143B)
--------pr_labeler.yml(402B)
----tests()
--------one-time-execution-method-test.mjs(1KB)
----.vscode()
--------launch.json(460B)
----LICENSE(1KB)
----package.json(1KB)
----src()
--------one-time-execution-method.mjs(1KB)
----.npmignore(55B)

网友评论