Skip to content

Instantly share code, notes, and snippets.

@bvaughn
bvaughn / Selectable.jsx
Last active Aug 27, 2019 — forked from AlexFrazer/Selectable.jsx
Fork of gist.github.com/AlexFrazer/aed3810407aaf23b23168449a7ef83bf to answer question
View Selectable.jsx
import * as React from "react";
import * as rbush from "rbush";
export const SelectableContext = React.createContext();
export class SelectableGroup extends React.PureComponent {
static defaultProps = {
tolerance: 10
};
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>js-search indexing</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>