Skip to content

Commit

Permalink
Add redisClient.mget() type for Redis (#1710)
Browse files Browse the repository at this point in the history
  • Loading branch information
stouf authored and gantoine committed Jan 9, 2018
1 parent cd1469e commit ebf556d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions definitions/npm/redis_v2.x.x/flow_v0.34.x-/redis_v2.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ declare module "redis" {
get: (key: string) => any;
set: (key: string, value: string, cb?: (error: Error | null) => void) => void;
del: (...keys: Array<string>) => void;
mget: (keys: Array<string>, (Error | null, Array<string | null>) => void) => void;
rpoplpush: (source: string, destination: string) => string | void;
publish: (topic: string, value: any) => void;
subscribe: (topic: string) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ client.lpush("key", "value");
client.lpush("key");
// $ExpectError
client.lpush("key", { foo: 'bar' });

client.mget(["key1", "key2"], (error, entries) => {
if (error === null) {
console.log('Error!');
return;
}
console.log(entries.join(','));
});

0 comments on commit ebf556d

Please sign in to comment.