Articles tagged with TypeScript
Recently at work, I encountered a problem with a function that should have returned a custom promise subclass. The goal of this subclass is to be able to call a cancel method to cancel some pending action done within the promise and then reject it. It looks like this:
class …
Read more...
While wandering how to run some tests with JavaScript, I discorvered that deno, a JavaScript runtime like NodeJS, has support for jupyter notebooks thanks to this article. It works perfectly. Install deno (probably available in your distribution repositories), run deno jupyter --install and you are good to go!
To get …
Read more...
During the summer, I decided to test a few frontend framework to see what’s going on in this space and form a better opinions over alternatives to React. I tested Svelte because after hearing from it I felt attracted to it, Vue because it is popular, React to have …
Read more...
Today I'd like to dig a bit on enums in TypeScript and their potential alternatives. For this, I'll be using the playground and TypeScript 5.1.6 (latest released version when I am writing this). I expect you to know what enums are and to be comfortable in TypeScript.
Let's …
Read more...
Here is an unsorted type tips I find useful in TypeScript. I may update it when I find new ones. Don't hesitate to share yours in the comments!
Another good start, is to read this page from the handbook which list various builtin utility types. If you are really motivated …
Read more...
I spoke last year of Aurelia store in this article At the time, it wasn't possible to combine Aurelia Store and Immer. The root cause of the issue was fixed in the latest version of Immer (7.0), so we can now combine both.
Let's study how to do this …
Read more...
I feel like Progressive Web Application (PWA for short) are a more and more popular way to build mobile apps. That's understandable since you can use the same technology you use to build a SPA to build one! So …
Read more...
On my spare time, I am developing a board game that uses the Aurelia framework. I currently manage the state in a service without any dedicated state management solutions (like RxJS, Aurelia store, Redux, …). And I feel I am reaching to the limit of what I can do with it …
Read more...
Some time ago, I wanted to add some tests (behavior and render) on an Aurelia component that uses the i18n plugin and more precisely the df attribute in the view to display a localized date.
Since it was a while back (I wanted to write it earlier but couldn't), my …
Read more...
If you use Aurelia with the i18n plugin, you will have to maintain JSON files that will map a translation key to an actual translation. Manually editing the file to add/remove keys can be tedious.
Luckily, keys can be extracted automatically thanks to i18next-scanner. It can extract translation keys …
Read more...