1.0.2 • Published 5 years ago

react-konami-code-decorator v1.0.2

Weekly downloads
19
License
ISC
Repository
github
Last release
5 years ago

React Konami Code

HOC class decorator which provides thirtyLives boolean prop to wrapped component. thirtyLives is only true if the Konami Code has just been typed in sequence - one stroke more or less and it is false. Keystrokes are only kept in state while they are in sequence.

Install module as usual then use like any other decorator:

import withKonami from 'react-konami-code'

@withKonami
class YourClass extends React.Component {
  ...
  render() {
    const {thirtyLives} = this.props
    ...
  }
}

withKonami(YourClassOrReactFunction) also works.

This project is not affiliated with or endorsed in any way by the Konami group of companies