Skip to content

Commit

Permalink
better code
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf committed Jul 23, 2024
1 parent 45ed742 commit ed17871
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions examples/jetstream/list-subjects/deno/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ const nc = await connect({ servers });
const jsm = await nc.jetstreamManager();
const js = nc.jetstream();

const randomName: () => string = function (): string {
return nuid.next().substring(18)
};

// Create a stream with a few random subjects
const plainSubj = `PLAIN_${randomName()}`;
const gtSubj = `GT_${randomName()}`;
const starSubj = `STAR_${randomName()}`;
const name = `EVENTS_${randomName()}`;
const plainSubj = `PLAIN_${nuid.next().substring(18)}`;
const gtSubj = `GT_${nuid.next().substring(18)}`;
const starSubj = `STAR_${nuid.next().substring(18)}`;
const name = `EVENTS_${nuid.next().substring(18)}`;

let si = await jsm.streams.add({
name,
Expand Down

0 comments on commit ed17871

Please sign in to comment.