Last active
August 22, 2017 17:26
-
-
Save Kelin2025/7e14637d3354e266fe36c5ef06747d72 to your computer and use it in GitHub Desktop.
Apicase call example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import apis from './container.js' | |
// Note that it always resolves | |
let res = await apis.go(serviceName, queryData, params) | |
// You can handle result as before | |
// But you often do not have to do it | |
// because of next features I'll talk about | |
if (res.ok) { | |
console.log('Success') | |
} else { | |
console.log('Fail') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment