Following #1475, I'm documenting the newly exported useInteraction and useModifierKeyPressed hooks.
I'm also taking the opportunity to do a bit of a refactoring now, to avoid a breaking change down the line:
InteractionEntry (the second parameter of useInteraction) becomes InteractionConfig
We no longer need to cast the modifierKey prop to an array before calling useInteraction and useMdifierKeyPressed (thus removing the need for getModifierKeyArray)
I'm introducing an Interaction class internally to encapsulate the casting of the modiferKeys and buttons arrays and the logic of whether an interaction "matches" a mouse event.
Following #1475, I'm documenting the newly exported
useInteraction
anduseModifierKeyPressed
hooks.I'm also taking the opportunity to do a bit of a refactoring now, to avoid a breaking change down the line:
InteractionEntry
(the second parameter ofuseInteraction
) becomesInteractionConfig
modifierKey
prop to an array before callinguseInteraction
anduseMdifierKeyPressed
(thus removing the need forgetModifierKeyArray
)Interaction
class internally to encapsulate the casting of themodiferKeys
andbuttons
arrays and the logic of whether an interaction "matches" a mouse event.