Skip to content

Commit

Permalink
fix(useNTState): Fix for undefined returning from topic.publish
Browse files Browse the repository at this point in the history
  • Loading branch information
CrispyBacon1999 committed Mar 4, 2024
1 parent 99f78fa commit 8aec02c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/useNTState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const useNTState = <T extends NTTopicTypes>(
const clientTopic = client.createTopic(key, ntType, defaultValue);
setTopic(clientTopic);
const subscriptionUID = clientTopic.subscribe(listener);
clientTopic.publish().then(() => {
console.log("Published topic:", key);
});
clientTopic.publish();

return () => {
if (subscriptionUID && clientTopic) {
Expand Down

0 comments on commit 8aec02c

Please sign in to comment.