Download wp-calypso/client/state/activity-log/reducer.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 974 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/activity-log/reducer.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/state/activity-log/reducer.js
-
curl -L -o reducer.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/state/activity-log/reducer.js
974 Bytes
| import { withStorageKey } from '@automattic/state-utils'; | |
| import { ACTIVITY_LOG_FILTER_SET, ACTIVITY_LOG_FILTER_UPDATE } from 'calypso/state/action-types'; | |
| import { combineReducers, keyedReducer } from 'calypso/state/utils'; | |
| import { backupRequest, backupProgress, granularBackupDownloadRequested } from './backup/reducer'; | |
| import { restoreProgress, restoreRequest } from './restore/reducer'; | |
| export const emptyFilter = { | |
| page: 1, | |
| }; | |
| export const filterState = ( state = emptyFilter, { type, filter } ) => { | |
| switch ( type ) { | |
| case ACTIVITY_LOG_FILTER_SET: | |
| return { ...emptyFilter, ...filter }; | |
| case ACTIVITY_LOG_FILTER_UPDATE: | |
| return { ...state, ...filter }; | |
| default: | |
| return state; | |
| } | |
| }; | |
| const combinedReducer = combineReducers( { | |
| filter: keyedReducer( 'siteId', filterState ), | |
| restoreProgress, | |
| restoreRequest, | |
| backupProgress, | |
| backupRequest, | |
| granularBackupDownloadRequested, | |
| } ); | |
| export default withStorageKey( 'activityLog', combinedReducer ); | |