@@ -842,7 +842,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
842
842
nextTick ( ( ) : void => {
843
843
// get all the calls in this instance, resolve with it
844
844
// and then clear the queue so we don't add more
845
- // (anyhting after this will be added to a new queue)
845
+ // (anything after this will be added to a new queue)
846
846
const calls = queue [ queueIdx ] [ 1 ] ;
847
847
848
848
delete queue [ queueIdx ] ;
@@ -871,15 +871,17 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
871
871
// Decorate the base storage call. In the case or rxjs or promise-without-callback (await)
872
872
// we make a subscription, alternatively we push this through a single-shot query
873
873
private _decorateStorageCall < ApiType extends ApiTypes > ( creator : StorageEntry , decorateMethod : DecorateMethod < ApiType > ) : ReturnType < DecorateMethod < ApiType > > {
874
- return decorateMethod ( ( ...args : unknown [ ] ) : Observable < Codec > => {
874
+ const memoed = memo ( this . #instanceId , ( ...args : unknown [ ] ) : Observable < Codec > => {
875
875
const call = extractStorageArgs ( this . #registry, creator , args ) ;
876
876
877
877
if ( ! this . hasSubscriptions ) {
878
878
return this . _rpcCore . state . getStorage ( call ) ;
879
879
}
880
880
881
881
return this . _queueStorage ( call , this . #storageSubQ) ;
882
- } , {
882
+ } ) ;
883
+
884
+ return decorateMethod ( memoed , {
883
885
methodName : creator . method ,
884
886
overrideNoSub : ( ...args : unknown [ ] ) =>
885
887
this . _queueStorage ( extractStorageArgs ( this . #registry, creator , args ) , this . #storageGetQ)
0 commit comments