File size: 487 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { withStorageKey } from '@automattic/state-utils';
import {
	GUIDED_TOUR_UPDATE,
	GUIDED_TOUR_PAUSE,
	GUIDED_TOUR_RESUME,
} from 'calypso/state/action-types';

export function guidedTours( state = {}, action ) {
	switch ( action.type ) {
		case GUIDED_TOUR_UPDATE:
		case GUIDED_TOUR_PAUSE:
		case GUIDED_TOUR_RESUME: {
			const { type, ...update } = action;
			return { ...state, ...update };
		}
	}
	return state;
}

export default withStorageKey( 'guidedTours', guidedTours );