Skip to content

Commit

Permalink
docs: Document Hooks.mouseCapture (revery-ui#861)
Browse files Browse the repository at this point in the history
  • Loading branch information
glennsl authored May 26, 2020
1 parent a0ec051 commit 019771a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/UI_Hooks/Revery_UI_Hooks.re
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ let transitionf =

let spring = SpringHook.spring;

/**
* let%hook (captureMouse, captureState) = Hooks.mouseCapture(...);
*
* where [captureMouse] requires the initial state to be passed as its argument.
*
* Each callback is passed the current state and event data, and requires either a
* state value to be returned or [None] to stop the capture.
*/
let mouseCapture =
(
~onMouseDown=(state, _evt) => Some(state),
Expand Down

0 comments on commit 019771a

Please sign in to comment.