client/state/plugins/installed/reducer.js
function plugin( state, action ) {
	switch ( action.type ) {
		case PLUGIN_ACTIVATE_REQUEST_SUCCESS:
		case PLUGIN_DEACTIVATE_REQUEST_SUCCESS:
		case PLUGIN_AUTOUPDATE_ENABLE_REQUEST_SUCCESS:
		case PLUGIN_AUTOUPDATE_DISABLE_REQUEST_SUCCESS:
			if ( state.id !== action.data.id ) {
				return state;
			}
			return Object.assign( {}, state, action.data );
		case PLUGIN_UPDATE_REQUEST_SUCCESS:
			if ( state.id !== action.data.id ) {
				return state;
			}
			return Object.assign( {}, omit( state, 'update' ), action.data );
		default:
			return state;
	}
}
function plugin( state, action ) {
	switch ( action.type ) {
		case PLUGIN_ACTIVATE_REQUEST_SUCCESS:
		case PLUGIN_DEACTIVATE_REQUEST_SUCCESS:
		case PLUGIN_AUTOUPDATE_ENABLE_REQUEST_SUCCESS:
		case PLUGIN_AUTOUPDATE_DISABLE_REQUEST_SUCCESS:
			if ( state.id !== action.data.id ) {
				return state;
			}
			return Object.assign( {}, state, action.data );
		case PLUGIN_UPDATE_REQUEST_SUCCESS:
			if ( state.id !== action.data.id ) {
				return state;
			}
			return Object.assign( {}, omit( state, 'update' ), action.data );
		default:
			return state;
	}
}
function plugin ( state , action ) { switch ( action . type ) { case PLUGIN_ACTIVATE_REQUEST_SUCCESS : case PLUGIN_DEACTIVATE_REQUEST_SUCCESS : case PLUGIN_AUTOUPDATE_ENABLE_REQUEST_SUCCESS : case PLUGIN_AUTOUPDATE_DISABLE_REQUEST_SUCCESS : if ( state . id !== action . data . id ) { return state ; } return Object . assign ( { } , state , action . data ) ; case PLUGIN_UPDATE_REQUEST_SUCCESS : if ( state . id !== action . data . id ) { return state ; } return Object . assign ( { } , omit ( state , 'update' ) , action . data ) ; default : return state ; } }
/*
Tracks the state of a single premium plugin object
/ * Tracks the state of a single premium plugin object