1.1.0 • Published 1 year ago

react-use-konami v1.1.0

Weekly downloads
637
License
MIT
Repository
github
Last release
1 year ago

react-use-konami Build Status

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;
1.1.0

1 year ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago