Skip to content

Commit

Permalink
delete unused helper
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Sep 30, 2022
1 parent 7cd3356 commit e695bf8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
6 changes: 1 addition & 5 deletions packages/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const server = app.listen(3000)
app.get('/', (req, res) => res.send('Hello World!'));

const onExit = async () => {
await analytics.closeAndFlush() // flush all existing events
await analytics.closeAndFlush() // flush all existing events
console.log("Closing server ...");
server.close(() => process.exit());
setTimeout(() => {
Expand All @@ -49,10 +49,6 @@ const onExit = async () => {

process.on("SIGINT", onExit);
process.on("SIGTERM", onExit);

process.on('SIGINT', onExit)
process.on('SIGTERM', onExit);
```
```

## Event Emitter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ describe('Ability for users to exit without losing events', () => {
makeTrackCall: (analytics = ajs, cb?: (...args: any[]) => void) => {
analytics.track({ userId: 'foo', event: 'Thing Updated', callback: cb })
},
listenOnDrain: (): Promise<undefined> => {
return new Promise((resolve) => {
ajs.once('drained', () => resolve(undefined))
})
},
}

describe('drained emitted event', () => {
Expand Down

0 comments on commit e695bf8

Please sign in to comment.