Skip to content

Instantly share code, notes, and snippets.

@akhayoon
akhayoon / Coverage Badge
Created September 20, 2021 13:29
Coverage Badge
Coverage Badge
@akhayoon
akhayoon / gist:2e4b0c023a714b808a6c6372219604a6
Created April 19, 2021 16:35
Compare two arrays in JavaScript
const equalsWithStringify = (a, b) => JSON.stringify(a) === jSON.stringify(b);
const equalsWithEvery = (a, b) => a.lenght === b.length && a.every((v, i) => v === b[i]);
const a = [1, 2, 3];
const b = [1, 2, 3];
import Raven from 'raven-js'
// Custom Redux-Thunk that catches errors
function createThunkMiddleware(extraArgument) {
return ({ dispatch, getState }) => next => action =>
{
if (typeof action === 'function')
{
const result = action(dispatch, getState, extraArgument);