UNPKG
edge-master
Version:
latest (0.10.0)
0.10.0
0.9.3
0.9.2
0.9.1
0.9.0
0.1.1
0.0.1
A Micro Framework for Edges
github.com/sharif3271/edge-master
sharif3271/edge-master
edge-master
/
dist
/
Task.js
2 lines
(1 loc)
•
214 B
JavaScript
View Raw
1
2
"use strict"
;export
class
Task
{
constructor
(e){
this
.
do
=e.
do
,
this
.
when
=e.
when
,
this
.doThen=e.doThen}async run(e){
return
this
.
when
?
this
.
when
(e)?
this
.
do
(e):
this
.doThen?
this
.doThen(e):Promise.resolve(e.res):
this
.
do
(e)}}