-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add type file with getMulti
#4
Conversation
*/ | ||
getMulti<Keys extends string>( | ||
keys: Keys[] | ||
): Promise<{ values: { [K in Keys]?: Buffer | null }; flags: Buffer | null }>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're sure? these really seem like strings to me based on the unittests, I think the docs in memjs had been wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var assertor = function(err, val, flags) {
console.log('types')
console.error(val['hello1'])
console.error(typeof val['hello1'])
t.deepEqual({
hello1: 'world1',
hello3: 'world3',
hello4: 'world4',
}, val);
t.false(flags);
t.equal(null, err);
};
client.getMulti(['hello1', 'hello2', 'hello3', 'hello4'], assertor);
testAllCallbacksEmpty(t, dummyServer1);
testAllCallbacksEmpty(t, dummyServer2);
return client.getMulti(['hello1', 'hello2', 'hello3', 'hello4']).then(function(res) {
assertor(null, res.values, res.flags);
world1
string
world1
string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm okay I want to figure this out today, I was surprised the docs were
"wrong" ... will look a bit more, is confusing me.
…On Mon, Mar 29, 2021 at 1:05 PM Jake Teton-Landis ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lib/memjs/memjs.d.ts
<#4 (comment)>:
> +
+ /**
+ * MULTI-GET / GET-MULTI
+ *
+ * Retrieves the value at the given keys in memcache.
+ *
+ * The callback signature is:
+ *
+ * callback(err, values, flags)
+ *
+ * @param keys
+ * @param callback
+ */
+ getMulti<Keys extends string>(
+ keys: Keys[]
+ ): Promise<{ values: { [K in Keys]?: Buffer | null }; flags: Buffer | null }>;
Very weird. Here's me, in a nodejs REPL:
[image: image]
<https://user-images.githubusercontent.com/296279/112872804-a6dce580-9075-11eb-93f9-c49f6ebbac91.png>
Test script using promise:
[image: image]
<https://user-images.githubusercontent.com/296279/112873213-32ef0d00-9076-11eb-81e2-8071d0b14977.png>
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADMZMGSSSAEYGOM2WRSGP3TGCXOHANCNFSM4Z73SNUQ>
.
|
I don't like the workflow of using patch-package on @types/memjs, it's hard to iterate on that.