first commit
This commit is contained in:
19
lib/components/timeline/proxy.js
Normal file
19
lib/components/timeline/proxy.js
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
const {receivedTimeline} = require('./actions')
|
||||
|
||||
module.exports = {
|
||||
// urls that should be called for the remote actions
|
||||
urls: {
|
||||
fetch: 'https://layla.amazon.de/api/cards?limit=50',
|
||||
},
|
||||
postHooks: {
|
||||
// called after the timeline has been fetched
|
||||
fetch: (store, data) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
store.dispatch(receivedTimeline(data.cards))
|
||||
resolve(data)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user