Skip to content

Instantly share code, notes, and snippets.

@yanmendes
Created January 15, 2019 13:10
Show Gist options
  • Save yanmendes/1d7437122b4421bdd08db89a1263c3c3 to your computer and use it in GitHub Desktop.
Save yanmendes/1d7437122b4421bdd08db89a1263c3c3 to your computer and use it in GitHub Desktop.
//Refactor: do this in a smarter way
let columns = []
_.each(res.results, res => {
_.each(Object.keys(res), key => {
if (!_.find(columns, o => o.key === key))
columns.push({ key: key, title: key, dataIndex: key })
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment