Skip to content

Commit

Permalink
fix(remote-control): fix ts-ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
pierpo committed Jul 12, 2023
1 parent 8e4363f commit f02b801
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import RemoteControlManager from './remote-control/RemoteControlManager';

SpatialNavigation.configureRemoteControl({
remoteControlSubscriber: (callback) => {
const mapping = {
const mapping: { [key in SupportedKeys]: Directions | null } = {
[SupportedKeys.Right]: Directions.RIGHT,
[SupportedKeys.Left]: Directions.LEFT,
[SupportedKeys.Up]: Directions.UP,
[SupportedKeys.Down]: Directions.DOWN,
[SupportedKeys.Enter]: Directions.ENTER,
[SupportedKeys.Back]: null,
};

const remoteControlListener = (keyEvent: SupportedKeys) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO fix me, but this is just a demo anyway
callback(mapping[keyEvent]);
};

Expand Down

0 comments on commit f02b801

Please sign in to comment.