lbry-desktop/src/ui/reducers.js

52 lines
1.6 KiB
JavaScript
Raw Normal View History

2019-04-04 23:05:23 +02:00
import { combineReducers } from 'redux';
import { connectRouter } from 'connected-react-router';
2019-06-11 20:10:58 +02:00
import {
claimsReducer,
fileInfoReducer,
searchReducer,
walletReducer,
notificationsReducer,
2019-06-17 22:32:38 +02:00
tagsReducerBuilder,
2019-06-11 20:10:58 +02:00
} from 'lbry-redux';
2019-05-07 23:38:29 +02:00
import { userReducer, rewardsReducer, costInfoReducer, blacklistReducer, homepageReducer, statsReducer } from 'lbryinc';
2019-04-04 23:05:23 +02:00
import appReducer from 'redux/reducers/app';
import availabilityReducer from 'redux/reducers/availability';
import contentReducer from 'redux/reducers/content';
import settingsReducer from 'redux/reducers/settings';
import subscriptionsReducer from 'redux/reducers/subscriptions';
import publishReducer from 'redux/reducers/publish';
2019-06-17 22:32:38 +02:00
import { defaultKnownTags, defaultFollowedTags } from 'constants/tags';
function getDefaultKnownTags() {
return defaultFollowedTags.concat(defaultKnownTags).reduce(
(tagsMap, tag) => ({
...tagsMap,
[tag]: { name: tag },
}),
{}
);
}
2019-04-04 23:05:23 +02:00
export default history =>
combineReducers({
router: connectRouter(history),
app: appReducer,
availability: availabilityReducer,
blacklist: blacklistReducer,
claims: claimsReducer,
content: contentReducer,
costInfo: costInfoReducer,
fileInfo: fileInfoReducer,
homepage: homepageReducer,
notifications: notificationsReducer,
publish: publishReducer,
rewards: rewardsReducer,
search: searchReducer,
settings: settingsReducer,
stats: statsReducer,
subscriptions: subscriptionsReducer,
2019-06-17 22:32:38 +02:00
tags: tagsReducerBuilder({ followedTags: defaultFollowedTags, knownTags: getDefaultKnownTags() }),
2019-04-04 23:05:23 +02:00
user: userReducer,
wallet: walletReducer,
});