mirror of
https://git.sr.ht/~ashkeel/strimertul
synced 2024-09-18 01:50:50 +00:00
fix: fix issue where live keys didn't fetch an initial value
This commit is contained in:
parent
d72b8834a3
commit
5f4a909017
1 changed files with 1 additions and 0 deletions
|
@ -29,6 +29,7 @@ export function useLiveKeyString(key: string) {
|
|||
|
||||
useEffect(() => {
|
||||
const subscriber: SubscriptionHandler = (v) => setData(v);
|
||||
void client.getKey(key).then((value) => setData(value));
|
||||
void client.subscribeKey(key, subscriber);
|
||||
return () => {
|
||||
void client.unsubscribeKey(key, subscriber);
|
||||
|
|
Loading…
Reference in a new issue