Skip to content

Commit fedb240

Browse files
authored
Merge pull request #1270 from i-love-neko-girls/main
feat: add `Symbol.dispose` property to allow using Elysia like `using server = app.listen(3000)`
2 parents 63f5ab0 + f15b041 commit fedb240

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6727,6 +6727,10 @@ export default class Elysia<
67276727
}
67286728
}
67296729

6730+
[Symbol.dispose] = () => {
6731+
this.stop()
6732+
}
6733+
67306734
/**
67316735
* Wait until all lazy loaded modules all load is fully
67326736
*/

0 commit comments

Comments
 (0)