import { Observable } from 'rxjs' ; import { Action } from '@ngrx/store' ; import { AdminActions , AdminActionTypes } from '../actions' ; import { SearchResults , Question } from 'shared-library/shared/model' ; export function questionsSearchResults ( state = [ ] , action ) { switch ( action . type ) { case AdminActionTypes . LOAD_QUESTIONS_SUCCESS : return action . payload ; default : return state ; } } export function unpublishedQuestions ( state = [ ] , action ) { switch ( action . type ) { case AdminActionTypes . LOAD_UNPUBLISHED_QUESTIONS_SUCCESS : return action . payload ; default : return state ; } } ; export function getQuestionToggleState ( state = null , action ) { switch ( action . type ) { case AdminActionTypes . SAVE_QUESTION_TOGGLE_STATE : return action . payload . toggle_state ; default : return state ; } } ; export function getArchiveToggleState ( state = null , action ) { switch ( action . type ) { case AdminActionTypes . SAVE_ARCHIVE_TOGGLE_STATE : return action . payload . toggle_state ; default : return state ; } } ;