react-konami-hook

A hook for reacting to the Konami Code

  • 所有者: alexanderson1993/react-konami-hook
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

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!

主要指標

概覽
名稱與所有者alexanderson1993/react-konami-hook
主編程語言JavaScript
編程語言HTML (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2018-11-15 16:46:01
推送於2018-11-16 19:53:24
最后一次提交2018-11-16 12:53:18
發布數0
用户参与
星數63
關注者數2
派生數2
提交數7
已啟用問題?
問題數0
打開的問題數0
拉請求數1
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?