-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add changelog for ES decorators
- Loading branch information
1 parent
13ca96c
commit 268d76a
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
'@freshgum/typedi': minor | ||
--- | ||
|
||
**We now support ES decorators**! Grab the new ESService decorator from contrib/es! | ||
|
||
To use this, you'll need to disable `experimentalDecorators` in your TypeScript | ||
configuration file. Note that, by doing this, you won't be able to utilise the | ||
legacy decorators included in the package (`Service`). | ||
|
||
Here's an example: | ||
|
||
```ts | ||
import { ESService } from '@freshgum/typedi/contrib/es'; | ||
|
||
@ESService([ ]) | ||
export class MyService { } | ||
``` | ||
|
||
Note that the **legacy decorators have not been removed** for backwards-compatibility | ||
reasons: you're still able to use them just as before. | ||
|
||
Many thanks to Axel Rauschmayer for providing | ||
[a very detailed guide re: ES decorators](https://2ality.com/2022/10/javascript-decorators.html). |