react-konami-hook

A hook for reacting to the Konami Code

  • Owner: alexanderson1993/react-konami-hook
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

React Konami Hook ?

All Contributors

React hook for adding the Konami code to your app

Note: This is using the new
React Hooks API Proposal which is
subject to change until React 16.7 final.

You'll need to install react, react-dom, etc at ^16.7.0-alpha.2

Edit useKonami hook

Install

yarn add react-konami-hook

or

npm install --save react-konami-hook

Usage

Just put a callback function into the hook for when the Konami Code is entered.
Simple as that!

import useKonami from "react-konami-hook";

function App() {
  useKonami(() => alert("Nice Job!"));
  return (
    <div
      style={{
        width: "100%",
        height: "100%",
        display: "flex",
        alignItems: "center",
        justifyContent: "center"
      }}
    >
      <h1 style={{ fontFamily: "sans-serif" }}>Use the Konami Code</h1>
    </div>
  );
}

Then ⬆️⬆️⬇️⬇️⬅➡⬅️➡️BA

Example

In the project folder:

yarn
yarn example

or

npm install
npm run example

Contributors

Thanks goes to these wonderful people
(emoji key):

This project follows the
all-contributors
specification. Contributions of any kind welcome!

Main metrics

Overview
Name With Owneralexanderson1993/react-konami-hook
Primary LanguageJavaScript
Program languageHTML (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2018-11-15 16:46:01
Pushed At2018-11-16 19:53:24
Last Commit At2018-11-16 12:53:18
Release Count0
用户参与
Stargazers Count63
Watchers Count2
Fork Count2
Commits Count7
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count1
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private