Package Exports
- react-use-konami
- react-use-konami/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-use-konami) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-use-konami 
React custom hook to add easter egg functionality to your React components.
Installation
npm install --save react-use-konami
Usage
import React from 'react';
import useKonami from 'react-use-konami';
const MyComponent = () => {
/**
* takes two parameters:
* handler: () => any
* options?: {code: string[]}
*
* the default code is:
* ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a', 'Enter']
*/
useKonami(() => {
console.log('hi easter egg!');
}, {
code: ['ArrowUp', 'ArrowDown', 'Enter'],
});
return <div> Hi World </div>;
}
export default MyComponent;