All files / actions feedback.ts

71.43% Statements 5/7
100% Branches 2/2
33.33% Functions 1/3
71.43% Lines 5/7
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 27 28 29        2x 2x 2x                             2x       2x      
import { FeedbackData } from '../models';
import { ErrorAction } from './action.types';
//tslint:disable:no-reserved-keywords
 
export enum Actions {
  update = 'feedback.update',
  send = 'feedback.send'
}
 
export interface UpdateFeedback {
  type: Actions.update;
  feedback: FeedbackData;
}
 
export interface SendFeedback extends ErrorAction {
  type: Actions.send;
  feedback: FeedbackData;
}
 
export type FeedbackActions = UpdateFeedback | SendFeedback;
 
export function updateFeedback(feedback: FeedbackData): UpdateFeedback {
  return { type: Actions.update, feedback };
}
 
export function sendFeedback(feedback: FeedbackData): SendFeedback {
  return { type: Actions.send, feedback };
}