0
0
Fork 0

Adding notifications column

This commit is contained in:
Eugen Rochko 2016-11-20 19:39:18 +01:00
parent da2ef4d676
commit 38dd85daab
30 changed files with 512 additions and 76 deletions

View file

@ -1,5 +1,5 @@
import { createSelector } from 'reselect'
import Immutable from 'immutable';
import Immutable from 'immutable';
const getStatuses = state => state.get('statuses');
const getAccounts = state => state.get('accounts');
@ -50,9 +50,9 @@ const assembleStatus = (id, statuses, accounts) => {
return status.set('reblog', reblog).set('account', accounts.get(status.get('account')));
};
const getNotificationsBase = state => state.get('notifications');
const getAlertsBase = state => state.get('alerts');
export const getNotifications = createSelector([getNotificationsBase], (base) => {
export const getAlerts = createSelector([getAlertsBase], (base) => {
let arr = [];
base.forEach(item => {
@ -66,3 +66,12 @@ export const getNotifications = createSelector([getNotificationsBase], (base) =>
return arr;
});
export const makeGetNotification = () => {
return createSelector([
(_, base) => base,
(state, _, accountId) => state.getIn(['accounts', accountId])
], (base, account) => {
return base.set('account', account);
});
};