(
table_action: TableAction,
page_current: number,
page_size: number,
page_count: number | undefined,
setProps: SetProps,
data: Data
)
| 102 | } |
| 103 | |
| 104 | const getter = ( |
| 105 | table_action: TableAction, |
| 106 | page_current: number, |
| 107 | page_size: number, |
| 108 | page_count: number | undefined, |
| 109 | setProps: SetProps, |
| 110 | data: Data |
| 111 | ): IPaginator => { |
| 112 | if (table_action === TableAction.Native) { |
| 113 | page_count = lastPage(data, page_size); |
| 114 | } |
| 115 | |
| 116 | if (page_count) { |
| 117 | page_count = Math.max(page_count, 1); |
| 118 | } |
| 119 | |
| 120 | return makePaginator( |
| 121 | table_action === TableAction.None |
| 122 | ? null |
| 123 | : { |
| 124 | setProps, |
| 125 | page_current, |
| 126 | page_count |
| 127 | } |
| 128 | ); |
| 129 | }; |
| 130 | |
| 131 | export default memoizeOneFactory(getter); |
searching dependent graphs…