From 6a80a97a4c45a33d9fe30ef8867be6dbea922eee Mon Sep 17 00:00:00 2001 From: himanoa Date: Mon, 16 Dec 2024 23:28:41 +0900 Subject: [PATCH] Update requestAnimationFrame to include timestamp parameter Change the type signature of requestAnimationFrame to pass the timestamp to the callback function, matching the Web API specification where requestAnimationFrame provides a DOMHighResTimeStamp parameter. --- CHANGELOG.md | 1 + src/Web/HTML/Window.purs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20f26bb..c48a178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based ## [Unreleased] Breaking changes: +- Update requestAnimationFrame to include timestamp parameter New features: diff --git a/src/Web/HTML/Window.purs b/src/Web/HTML/Window.purs index 490ab04..63d24ac 100644 --- a/src/Web/HTML/Window.purs +++ b/src/Web/HTML/Window.purs @@ -131,7 +131,7 @@ newtype RequestAnimationFrameId = RequestAnimationFrameId Int derive instance eqRequestAnimationFrameId :: Eq RequestAnimationFrameId derive instance ordRequestAnimationFrameId :: Ord RequestAnimationFrameId -foreign import requestAnimationFrame :: Effect Unit -> Window -> Effect RequestAnimationFrameId +foreign import requestAnimationFrame :: (Int -> Effect Unit) -> Window -> Effect RequestAnimationFrameId foreign import cancelAnimationFrame :: RequestAnimationFrameId -> Window -> Effect Unit