tcf
功能性try / catch / finally并具有异步支持
目录
用法
import tcf from "tcf" ;
// use for inline synchronous operations
const syncResult = tcf (
( ) => {
// ... some dangerous computation
return computed ;
} ,
( error ) => console . error ( error ) ,
( ) => cleanup ( )
) ;
// or for asynchronous operations
const asyncResult = await tcf (
async ( ) => {
// some dangerous computation
r
评论0
最新资源