Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
fix entry watch
Browse files Browse the repository at this point in the history
  • Loading branch information
harrysolovay committed Oct 21, 2022
1 parent 7272497 commit 1db3de9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions effect/EntryWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ export class EntryWatch<
const $storageKey_ = $storageKey(deriveCodec_, palletMetadata_, entryMetadata_);
const entryValueTypeI = Z.sel(entryMetadata_, "value");
const $entry = codec(deriveCodec_, entryValueTypeI);
const storageKey_ = Z.call(storageKey($storageKey_, ...keys), function wrapWithList(x) {
return [x];
});
const storageKeys = Z.call(
keys.length === 0 ? storageKey($storageKey_) : storageKey($storageKey_, keys),
function wrapWithList(v) {
return [v];
},
);
const watchInit = Z.call($entry, function entryWatchInit($entry) {
return U.mapCreateWatchHandler(
createWatchHandler,
Expand All @@ -56,7 +59,7 @@ export class EntryWatch<
this.root = new RpcSubscription(
config,
"state_subscribeStorage",
[storageKey_],
[storageKeys],
watchInit,
(ok) => {
return new RpcCall(config, "state_unsubscribeStorage", [ok.result]);
Expand Down

0 comments on commit 1db3de9

Please sign in to comment.