Skip to content

Instantly share code, notes, and snippets.

View klashxx's full-sized avatar
:atom:
Building

Juan Diego Godoy Robles klashxx

:atom:
Building
View GitHub Profile
import React from "react";
import { Link } from "react-router-dom";
export function createResource(getPromise) {
let cache = {};
let inflight = {};
let errors = {};
function load(key) {
inflight[key] = getPromise(key)