@@ -96,7 +96,6 @@ var multiCaching = function(caches, options) {
96
96
/**
97
97
* Then put back the options in the args Array
98
98
*/
99
- args . push ( options ) ;
100
99
101
100
if ( multi ) {
102
101
/**
@@ -120,7 +119,7 @@ var multiCaching = function(caches, options) {
120
119
var _isCacheableValue = getIsCacheableValueFunction ( cache ) ;
121
120
122
121
if ( multi ) {
123
- addResultToMap ( result , _isCacheableValue ) ;
122
+ addResultToMap ( result , _isCacheableValue , i ) ;
124
123
125
124
if ( keysToFetch . length === 0 || i === caches . length - 1 ) {
126
125
// Return an Array with the values merged from all the caches
@@ -155,7 +154,7 @@ var multiCaching = function(caches, options) {
155
154
return cb ( err , result ) ;
156
155
} ) ;
157
156
158
- function addResultToMap ( result , isCacheable ) {
157
+ function addResultToMap ( result , isCacheable , cacheIndex ) {
159
158
var key ;
160
159
var diff = 0 ;
161
160
@@ -171,6 +170,10 @@ var multiCaching = function(caches, options) {
171
170
// Add the result to our map
172
171
mapResult [ key ] = res ;
173
172
173
+ for ( let j = 0 ; j < cacheIndex ; j ++ ) {
174
+ caches [ j ] . store . set ( key , res ) ;
175
+ }
176
+
174
177
// delete key from our keysToFetch array
175
178
keysToFetch . splice ( i - diff , 1 ) ;
176
179
diff += 1 ;
0 commit comments