Defined visits TS types

This commit is contained in:
Alejandro Celaya
2020-08-27 17:56:48 +02:00
parent f283dc8569
commit f3a2535e2f
7 changed files with 88 additions and 38 deletions

View File

@@ -1,3 +0,0 @@
export const CREATE_VISIT = 'shlink/visitCreation/CREATE_VISIT';
export const createNewVisit = ({ shortUrl, visit }) => ({ shortUrl, visit, type: CREATE_VISIT });

View File

@@ -0,0 +1,12 @@
import { Action } from 'redux';
import { CreateVisit } from '../types';
export const CREATE_VISIT = 'shlink/visitCreation/CREATE_VISIT';
type CreateVisitAction = Action<typeof CREATE_VISIT> & CreateVisit;
export const createNewVisit = ({ shortUrl, visit }: CreateVisit): CreateVisitAction => ({
type: CREATE_VISIT,
shortUrl,
visit,
});