onRelease
Wraps a handler so it fires only on key-up (release)
import { onRelease } from "@roku-sdk/navigation";onRelease(handler: () => KeyResult): KeyPressHandlerDescription
Wraps a handler so it fires only on key-up (release). Mirrors onPress: the handler's verdict is passed through on the release, and the press consumes.
Parameters
| Name | Type | Description |
|---|---|---|
handler | () => KeyResult | Called on key-up. Return bubble to decline the release. |
Return values
Returns KeyPressHandler.
Example
onKey: { play: onRelease(() => stop()) }
// equivalent to: play: press => { if (!press) stop(); }Updated about 4 hours ago
What’s Next
Did this page help you?