【文件属性】:
文件名称:premote:将JavaScript远程操作包装在promise API中
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-21 19:37:41
JavaScript
预发
Visualforce中的具有难看的api。 Premote通过使您将Remote Action调用包装在基于Promise中来解决此。
要求
要使用Premote,您需要使用
正在安装
在页面的[removed]标记中包含Q
使用[removed]标记在页面上包含Premote
用法
您只需使用Premote的wrap()函数将任何Remote动作函数转换为返回Q承诺的函数。 这是基本用法:
var getAccount = Premote . wrap ( 'MyController.getAccount' ) ;
getAccount ( accountId )
. then ( function ( account ) {
console . log ( 'got the account: ' + account . Name ) ;
} )
. fai
【文件预览】:
premote-master
----.gitignore(13B)
----premote-min.js(1KB)
----package.json(709B)
----Gruntfile.js(749B)
----premote.js(3KB)
----LICENSE(1KB)
----README.md(3KB)