// on the main thread
import { apply } from 'object-diff-patch/apply';
import createWorker from 'workerize-loader!./worker.js';
const worker = createWorker();
const CACHE = new Map();
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
/* | |
The grammar below is intended for use with Jison Parser Generator (http://zaa.ch/jison/) | |
Paste the contents below int http://zaa.ch/jison/try/ to see it in action | |
*/ | |
/* ====== START GRAMMAR ====== */ | |
/* description: Parses kairosdb-datasource 'tag_values' queries */ | |
/* lexical grammar */ | |
%lex | |
%% |
Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.
I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a
beforeEach
. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern
that gives great defaults for each test example but allows every example to override props
when needed:
I've moved this file to this wiki page so it's easier to find!
function errorHandler(msg, url, line, column, err) { | |
// firefox bug to watch for 5 arg error handler | |
// https://bugzilla.mozilla.org/show_bug.cgi?id=630464 | |
/* | |
* most browsers don't give column number, | |
* but chrome can do it sometimes | |
*/ | |
if(typeof column == "object") { | |
err = column; |