1import React from "react";
2export var _passiveSupported = null;
4function checkPassiveSupported() {
5 if (_passiveSupported == null) {
7 window.addEventListener(
10 Object.defineProperty({}, "passive", {
12 _passiveSupported = true;
17 _passiveSupported = false;
20 return _passiveSupported;
23function createHandler(h) {
29function up(target, eventType, handler, options) {
30 target.addEventListener(
33 checkPassiveSupported() ? options : options.capture
37function down(target, eventType, handler, options) {
38 target.removeEventListener(
41 checkPassiveSupported() ? options : options.capture
45var GlobalEvent = function() {
49GlobalEvent.prototype = Object.create(React.Component.prototype);
51GlobalEvent.displayName = "GlobalEvent";
53GlobalEvent.prototype.componentDidMount = function() {
54 this._handler = createHandler(this.props.handler);
63GlobalEvent.prototype.componentDidUpdate = function(prevProps) {
64 down(prevProps.target, prevProps.eventType, this._handler, prevProps.options);
65 this._handler = createHandler(this.props.handler);
74GlobalEvent.prototype.componentWillUnmount = function() {
83GlobalEvent.prototype.render = function() {
84 return this.props.child;
87export {GlobalEvent as globalEvent_};
89export var unsafeWindowEventTarget = (function() {
90 if (typeof window === "undefined") {
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list