createLoader = (
  batchFn: Function,
  indexField: string | Function = 'id',
  cacheKeyFn: Function = key => key
) => (options?: DataLoaderOptions): Loader => {
  return new DataLoader(keys => {
    return batchFn(unique(keys)).then(
      normalizeRethinkDbResults(keys, indexField, cacheKeyFn)
    );
  }, options);
}
Create a dataloader instance for a request and type

Usage:
createUserLoader = () => createLoader(users => getUsers(users), 'id');