Hi,
Most or even all functions used for RPC currently return void.
On browsers that support Promise (or can have it polyfilled), you could return Promise if the callback parameter is empty.
It should be backwards compatible, but could give new possibilities.
For example for DataSource.fetchData(data, null, requestOptions) returned Promise would resolve to object {dsRequest: {...}, data: {...}, dsRequest: {...}}.
We could even use async function to have the code even simpler.
I am now experimenting with wrappers like fetchDataPromise(data, requestProperties) and so far have good results.
Best regards,
Janusz
"originally posted by Janusz "
Most or even all functions used for RPC currently return void.
On browsers that support Promise (or can have it polyfilled), you could return Promise if the callback parameter is empty.
It should be backwards compatible, but could give new possibilities.
For example for DataSource.fetchData(data, null, requestOptions) returned Promise would resolve to object {dsRequest: {...}, data: {...}, dsRequest: {...}}.
We could even use async function to have the code even simpler.
I am now experimenting with wrappers like fetchDataPromise(data, requestProperties) and so far have good results.
Best regards,
Janusz
"originally posted by Janusz "
Comment