Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

batchloader

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

batchloader - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

1

lib/mappedbatchloader.d.ts

@@ -8,3 +8,4 @@ import { IBatchLoader } from './types';

loadMany(keys: Key[]): Promise<MappedValue[]>;
mapLoader<RemappedValue>(mapFn: (value: MappedValue) => RemappedValue): MappedBatchLoader<Key, MappedValue, RemappedValue>;
private mapItems;
}

@@ -25,4 +25,7 @@ "use strict";

}
mapLoader(mapFn) {
return new MappedBatchLoader(this, mapFn);
}
}
exports.MappedBatchLoader = MappedBatchLoader;
//# sourceMappingURL=mappedbatchloader.js.map
export interface IBatchLoader<Key, Value> {
load(key: Key): Promise<Value>;
loadMany(keys: Key[]): Promise<Value[]>;
mapLoader<MappedValue>(mapFn: (value: Value) => MappedValue): IBatchLoader<Key, MappedValue>;
}

2

package.json
{
"name": "batchloader",
"version": "0.0.3",
"version": "0.0.4",
"description": "BatchLoader is a utility for data fetching layer to reduce requests via batching written in TypeScript. Inspired by Facebook's DataLoader",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -19,2 +19,8 @@ import { IBatchLoader } from 'src/types';

public mapLoader<RemappedValue>(
mapFn: (value: MappedValue) => RemappedValue
): MappedBatchLoader<Key, MappedValue, RemappedValue> {
return new MappedBatchLoader(this, mapFn);
}
private mapItems = (vs: Value[]): MappedValue[] | Promise<MappedValue[]> => {

@@ -21,0 +27,0 @@ const mapped = vs.map(this.mapFn);

export interface IBatchLoader<Key, Value> {
load(key: Key): Promise<Value>;
loadMany(keys: Key[]): Promise<Value[]>;
mapLoader<MappedValue>(
mapFn: (value: Value) => MappedValue
): IBatchLoader<Key, MappedValue>;
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc