Skip to content

Instantly share code, notes, and snippets.

@curtiswilkinson
Created February 9, 2017 22:56
Show Gist options
  • Save curtiswilkinson/92edd2a186cb266c2499284d1499645f to your computer and use it in GitHub Desktop.
Save curtiswilkinson/92edd2a186cb266c2499284d1499645f to your computer and use it in GitHub Desktop.
example function
import * as api from 'whatever'
interface ReturnPayload {
name: string,
value: string
}
export function saveAndProcessReturn(payload) {
const saveReturn: ReturnPayload[] = api.save('Route', payload)
return saveReturn.map(x => {
return { [x.name]: x.value }
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment