Skip to content

Instantly share code, notes, and snippets.

@junhoyeo
Created June 13, 2022 05:34
Show Gist options
  • Save junhoyeo/1c3b9ef7afa215bda92c1f496ef33d6b to your computer and use it in GitHub Desktop.
Save junhoyeo/1c3b9ef7afa215bda92c1f496ef33d6b to your computer and use it in GitHub Desktop.
const handler = () => {}
// params should be serialized key?
const [pages, setPages] = useState()
useEffect(() => {
while (cursor) {
const { data, cursor } = requester(params)
setPages(prev => [...prev, data])
}
}, [params])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment