Skip to content

Instantly share code, notes, and snippets.

View sujinleeme's full-sized avatar
🏃‍♀️
�CPH marathon

Sujin Lee sujinleeme

🏃‍♀️
�CPH marathon
View GitHub Profile
@sujinleeme
sujinleeme / MockFile.js
Created February 14, 2021 12:56 — forked from josephhanson/MockFile.js
Mock file for JavaScript based file upload - with basic test harness
// mock file
function MockFile() { };
MockFile.prototype.create = function (name, size, mimeType) {
name = name || "mock.txt";
size = size || 1024;
mimeType = mimeType || 'plain/txt';
function range(count) {
var output = "";
@sujinleeme
sujinleeme / useRect.tsx
Last active March 21, 2024 15:27 — forked from morajabi/useRect.js
useRect — getBoundingClientRect() React Hook with resize handler (TypeScript)
// Require to install a package from npm with ResizeObserver typings.
// yarn --dev @types/resize-observer-browser
import { useCallback, useLayoutEffect, useRef, useState } from "react";
import ResizeObserver from 'resize-observer-polyfill'
type RectResult = {
bottom: number;
height: number;
left: number;
@sujinleeme
sujinleeme / react-testing-library--renderWithRedux.md
Created November 26, 2020 22:16 — forked from fleepgeek/react-testing-library--renderWithRedux.md
An Improvement to renderWithRedux helper function to enable rerender

Basic Implmentation

function renderWithRedux(ui, { initialState, store = createStore(rootReducer, initialState) } = {}, renderFn = render) {
  const obj = {
    ...renderFn(<Provider store={store}>{ui}</Provider>),
    store,
  };
  obj.rerenderWithRedux = (el) => renderWithRedux(el, { store }, obj.rerender);
  return obj;
@sujinleeme
sujinleeme / README.md
Created March 30, 2018 13:46 — forked from akashnimare/README.md
A Beginners Guide to writing a Kickass README ✍

Project title

A little info about your project and/ or overview that explains what the project is about.

Motivation

A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.

Build status

Build status of continus integration i.e. travis, appveyor etc. Ex. -

Build Status