Skip to content

Commit

Permalink
Add type for redis.llen() (#1739)
Browse files Browse the repository at this point in the history
  • Loading branch information
stouf authored and gantoine committed Jan 19, 2018
1 parent c44c93d commit f988bcb
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 @@ -15,6 +15,7 @@ declare module "redis" {
cursor2: number,
(error: Error | null, entries: Array<string>) => void
) => boolean;
llen: (key: string, (error: Error | null, length: number) => void) => boolean;
hset: (topic: string, key: string, value: string) => number;
hget: (topic: string, key: string, value: string) => string | void;
hgetall: (topic: string, key: string) => Array<string> | void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ client.lrange("key", 0, 5, (error, entries) => {
console.log(entries.join(','));
});

client.llen('key', (error, length) => {
if (error !== null) {
console.error(error);
return;
}
console.log(length);
});

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

0 comments on commit f988bcb

Please sign in to comment.