addNewStatuses: mutation -> action
This is to add the current user.
This commit is contained in:
parent
e7637e4196
commit
de25c46670
2 changed files with 2 additions and 87 deletions
|
@ -5,7 +5,7 @@ import apiService from '../api/api.service.js'
|
|||
const update = ({store, statuses, timeline, showImmediately}) => {
|
||||
const ccTimeline = camelCase(timeline)
|
||||
|
||||
store.commit('addNewStatuses', {
|
||||
store.dispatch('addNewStatuses', {
|
||||
timeline: ccTimeline,
|
||||
statuses,
|
||||
showImmediately
|
||||
|
@ -41,55 +41,3 @@ const timelineFetcher = {
|
|||
}
|
||||
|
||||
export default timelineFetcher
|
||||
|
||||
// const timelineFetcherServiceFactory = ($ngRedux, apiService, $interval) => {
|
||||
// let fetcher;
|
||||
|
||||
// const update = ({statuses, timeline, showImmediately}) => {
|
||||
// const ccTimeline = camelCase(timeline);
|
||||
|
||||
// const action = {
|
||||
// type: 'ADD_NEW_STATUSES',
|
||||
// data: {
|
||||
// statuses,
|
||||
// timeline: ccTimeline,
|
||||
// showImmediately
|
||||
// }
|
||||
// };
|
||||
|
||||
// $ngRedux.dispatch(action);
|
||||
// $ngRedux.dispatch({type: 'UPDATE_TIMESTAMPS'});
|
||||
// };
|
||||
|
||||
// const fetchAndUpdate = ({timeline = 'friends', older = false, showImmediately = false}) => {
|
||||
// const args = { timeline };
|
||||
// const timelineData = $ngRedux.getState().statuses.timelines[camelCase(timeline)];
|
||||
|
||||
// if(older) {
|
||||
// args['until'] = timelineData.minVisibleId;
|
||||
// } else {
|
||||
// args['since'] = timelineData.maxId;
|
||||
// }
|
||||
|
||||
// apiService.fetchTimeline(args).
|
||||
// then((statuses) => update({statuses, timeline, showImmediately}));
|
||||
// };
|
||||
|
||||
// const startFetching = ({timeline = 'friends'}) => {
|
||||
// fetchAndUpdate({timeline, showImmediately: true});
|
||||
|
||||
// const boundFetchAndUpdate = () => fetchAndUpdate({timeline});
|
||||
// fetcher = $interval(boundFetchAndUpdate, 10000);
|
||||
// };
|
||||
|
||||
// const timelineFetcherService = {
|
||||
// startFetching,
|
||||
// fetchAndUpdate
|
||||
// };
|
||||
|
||||
// return timelineFetcherService;
|
||||
// };
|
||||
|
||||
// timelineFetcherServiceFactory.$inject = ['$ngRedux', 'apiService', '$interval'];
|
||||
|
||||
// export default timelineFetcherServiceFactory;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue