first commit
This commit is contained in:
20
lib/components/shopping_list/proxy.js
Normal file
20
lib/components/shopping_list/proxy.js
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict'
|
||||
|
||||
const {receivedShoppingList} = require('./actions')
|
||||
|
||||
module.exports = {
|
||||
// urls that should be called for the remote actions
|
||||
urls: {
|
||||
fetch: 'https://layla.amazon.de/api/todos?type=SHOPPING_ITEM&size=100',
|
||||
},
|
||||
// called after an remote http call to the shopping_list API has been successfully executed
|
||||
postHooks: {
|
||||
// called after the shopping items have been fetched
|
||||
fetch:(store, data) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
store.dispatch(receivedShoppingList(data.values))
|
||||
resolve(data)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user