Skip to content

Instantly share code, notes, and snippets.

@pckhoi
pckhoi / canvas.js
Created July 15, 2020 00:20
Khoi's code samples
// This is a React component that render sheet-like table using canvas in my latest project.
// Only visible rows and columns would be renderred. This solution give blazing fast performance
// and minimal memory footprint.
import React, { useRef, useEffect, useMemo } from "react";
import _ from "lodash";
import { renderGrid } from "./grid";
import { getRenderableContentCols, renderContentCells } from "./rows-content";
import { renderPKCells } from "./primary-key-columns";
package main
import (
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.