mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-08-24 14:48:42 +08:00
Create usePolling custom hook
This commit is contained in:
@@ -133,11 +133,14 @@ export type TasksActionTypes =
|
||||
| ListDeadTasksSuccessAction
|
||||
| ListDeadTasksErrorAction;
|
||||
|
||||
export function listActiveTasksAsync(qname: string) {
|
||||
export function listActiveTasksAsync(
|
||||
qname: string,
|
||||
pageOpts?: PaginationOptions
|
||||
) {
|
||||
return async (dispatch: Dispatch<TasksActionTypes>) => {
|
||||
dispatch({ type: LIST_ACTIVE_TASKS_BEGIN, queue: qname });
|
||||
try {
|
||||
const response = await listActiveTasks(qname);
|
||||
const response = await listActiveTasks(qname, pageOpts);
|
||||
dispatch({
|
||||
type: LIST_ACTIVE_TASKS_SUCCESS,
|
||||
queue: qname,
|
||||
|
Reference in New Issue
Block a user