Skip to content

Instantly share code, notes, and snippets.

@weikee94
Created November 20, 2015 02:15
Show Gist options
  • Select an option

  • Save weikee94/ecb022f11bbeda36a763 to your computer and use it in GitHub Desktop.

Select an option

Save weikee94/ecb022f11bbeda36a763 to your computer and use it in GitHub Desktop.
@weikee94
Copy link
Copy Markdown
Author

weikee94 commented Apr 25, 2023

Interval

  useEffect(() => {
    const interval = setInterval(() => {
      getList(
        {
          limit: pageState?.pageSize, // 分页获取数量
          page: pageState?.pageNum,
        },
      );
    }, 60000);

    return () => {
      clearInterval(interval);
    };
  }, [pageState]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment