File size: 581 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import { PREVIEW_URL_CLEAR, PREVIEW_URL_SET } from 'calypso/state/action-types';
import { combineReducers } from 'calypso/state/utils';
export function currentPreviewSiteId( state = null, action ) {
switch ( action.type ) {
case PREVIEW_URL_SET:
return action.siteId ?? null;
}
return state;
}
export function currentPreviewUrl( state = null, action ) {
switch ( action.type ) {
case PREVIEW_URL_SET:
return action.url;
case PREVIEW_URL_CLEAR:
return null;
}
return state;
}
export default combineReducers( {
currentPreviewSiteId,
currentPreviewUrl,
} );
|