// simple schema transform
let schema: {
id: '_id',
name: 'users'
}
let apiResponse: {
_id: 1,
firstName: 'tina'
}
let output: {
entities: {
'1': { _id: 1, firstName: 'tina' }
},
result: [1]
}
// schema transform on response object
let schema: {
key: 'entities',
id: '_id',
name: 'users'
}
let apiResponse: {
entities: [
{
_id: 1,
firstName: 'tina'
}
]
}
let output: {
entities: {
'1': { _id: 1, firstName: 'tina' }
},
result: [1]
}
// schema transform with entity transform
let schema: {
key: 'entities',
id: '_id',
name: 'users',
entityTransform: entity => entity.person
}
let apiResponse: {
entities: [
{
person: {
_id: 1,
firstName: 'tina'
},
otherProperty: {}
}
]
}
let result: {
entities: {
'1': { _id: 1, firstName: 'tina' }
},
result: [1]
}-
Notifications
You must be signed in to change notification settings - Fork 0
mikeyamadeo/redux-axios-api-middleware
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
redux middleware using axios making api calls with redux easy