Skip to content

Instantly share code, notes, and snippets.

@slightlytyler
Last active January 29, 2019 21:59
Show Gist options
  • Save slightlytyler/88e1bc77cbaa2d6186233aef284cd5f7 to your computer and use it in GitHub Desktop.
Save slightlytyler/88e1bc77cbaa2d6186233aef284cd5f7 to your computer and use it in GitHub Desktop.
Example paginated redux state
{
users: {
objects: {
alpha: {
loading: false,
error: null,
data: { id: 'alpha', ... },
},
beta: { ... },
gamma: { ... }
},
lists: {
'?': {
loading: false,
error: null,
ids: ['alpha', 'beta', 'gamma'],
pageInfo: { ... },
},
'?page=1,pageSize=2': {
loading: false,
error: null,
ids: ['alpha', 'beta'],
pageInfo: { ... },
},
'?q=alp': {
loading: false,
error: null,
ids: ['alpha'],
pageInfo: { ... },
},
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment