Skip to content

Instantly share code, notes, and snippets.

@Kelin2025
Last active August 22, 2017 17:26
Show Gist options
  • Save Kelin2025/7e14637d3354e266fe36c5ef06747d72 to your computer and use it in GitHub Desktop.
Save Kelin2025/7e14637d3354e266fe36c5ef06747d72 to your computer and use it in GitHub Desktop.
Apicase call example
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