Skip to content

Commit 7af9c2d

Browse files
committed
Small clean up
1 parent c8b0291 commit 7af9c2d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

index.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,8 @@ Mana.prototype.send = function send(args) {
649649
// Now that all modifications are complete we can finally assign the callback
650650
// to `assign` instance so it can generate the correct request id.
651651
//
652-
var cbId = options.json ? ':' + JSON.stringify(options.json) : '';
653-
var allCb = this.all(args.str + cbId);
652+
var key = args.str + (options.json ? ':' + JSON.stringify(options.json) : '');
653+
var allCb = this.all(key);
654654

655655
if (assign.fn) {
656656
// A callback already exists.
@@ -670,12 +670,10 @@ Mana.prototype.send = function send(args) {
670670
// reduce requests on the actual API.
671671
//
672672
if (args.fn) {
673-
if (options.method === 'GET' && this.fetching(args.str)) {
674-
return this.push(args.str, args.fn, assign);
675-
} else if (options.json) {
676-
this.push(args.str + ':' + JSON.stringify(options.json), args.fn);
673+
if (options.method === 'GET' && this.fetching(key)) {
674+
return this.push(key, args.fn, assign);
677675
} else {
678-
this.push(args.str, args.fn);
676+
this.push(key, args.fn);
679677
}
680678
}
681679

0 commit comments

Comments
 (0)