This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { DetectExternalEvents } from './detectexternalevents'; | |
const EXTERNAL_REACT_EVENTS = ['onMouseDown', 'onTouchStart']; | |
const EXTERNAL_DOM_EVENTS = ['mousedown', 'touchstart']; | |
export interface IDetectExternalClickProps { | |
component?: string; | |
onExternalClick: (event: Event) => void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DataRecord<T> { | |
// Constructor | |
constructor(value: T, initialRef: any) { | |
this.value = value; | |
this.refs = new Set([initialRef]); | |
} | |
// Properties | |
public readonly value: T; | |
public readonly refs: Set<any>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { observable, computed, ObservableMap } from 'mobx'; | |
import { objectUid } from './objectuid'; | |
export type KeyType = string | number | object; | |
export type RefType = string | number | object; | |
function keyFn(key: KeyType) { | |
if (typeof key === 'string') { | |
return key; |