Skip to content

Instantly share code, notes, and snippets.

@ciaranha
Created April 15, 2019 09:56
Show Gist options
  • Save ciaranha/b236ee3d199af7702533207152552a84 to your computer and use it in GitHub Desktop.
Save ciaranha/b236ee3d199af7702533207152552a84 to your computer and use it in GitHub Desktop.
airtable api
// with sorting
componentDidMount() {
base('Stops').select({
view: 'Grid view',
sort: [
{field: 'Days (planned)', direction: 'asc'}
],
})
.eachPage(
(records, fetchNextPage) => {
this.setState({
records
});
console.log(records);
fetchNextPage();
}
);
}
//original
componentDidMount() {
base('Stops').select({view: 'Grid view'})
.eachPage(
(records, fetchNextPage) => {
this.setState({
records
});
console.log(records);
fetchNextPage();
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment