15%
MIT
neglected> A small caching module for front-end requests

reDataLoader

A small caching module for front-end requests

Example

  • RE
  • ML
module MyLoaderSpec = {
  type t = int;
  let name = "MyLoader";
  let get context::_=? key => Js.Promise.resolve (int_of_string key);
};

module MyLoader = DataLoader.Make MyLoaderSpec;

let promise = MyLoader.load "1";
let promises = MyLoader.loadMany ["1", "2", "3"];
let promise = MyLoader.reload "1";
let promise = MyLoader.clear "1";
1525: <UNKNOWN SYNTAX ERROR>