page.ts 601 Bytes
Newer Older
Thor-Herman's avatar
Thor-Herman committed
1
2
3
4
export const PAGE_SIZE = 12;
export const CHANGE_PAGE = "CHANGE_PAGE";
export const UPDATE_TOTAL_PAGES = "UPDATE_TOTAL_PAGES";

Thor-Herman's avatar
Thor-Herman committed
5
// Redux state
Thor-Herman's avatar
Thor-Herman committed
6
7
8
9
10
11
export type PageState = {
    total: number,
    current: number,
    next: number | null,
    prev: number | null
}
Thor-Herman's avatar
Thor-Herman committed
12
13

// Redux actions
Thor-Herman's avatar
Thor-Herman committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
export type ChangePageAction = {
    type: string,
    payload: {
        current: number,
        next: number | null,
        prev: number | null,
    }
}
export type UpdatePageAction = {
    type: string,
    payload: { total: number, current: number },
}

export type PageActions = UpdatePageAction | ChangePageAction;