Friday, April 26, 2024
HomeJavaScriptCountdown to The New 12 months

Countdown to The New 12 months


That is the fifth in our DecEmber collection–Countdown to The New 12 months: 31 Days of Ember Addons”. We plan to focus on a brand new addon every day till the brand new yr, and we hope you may be part of us for the enjoyable!

Day 5

Let’s discuss ember-concurrency.
The expertise is a component pleasure, half tragedy.

The enjoyment comes from having elegant, simple options for issues like debouncing.
The tragedy is that I’ve to put in writing this code myself when I’m working in a non-Ember setting, however I suppose absence makes the guts develop fonder.

What It Does

The ember-concurrency addon helps you “write concise, strong, and exquisite asynchronous code.” For instance, take into consideration what ought to occur if a consumer quickly clicks a “submit” button. With this addon, there is a good technique to forestall 30 type submissions.
Or, what if an API request takes a very long time, and also you need to have the ability to cancel it? Guarantees will not make it easier to, however ember-concurrency duties will.

Why I Like It

With out ember-concurrency, it will take a variety of effort to handle beginning, interrupting, cancelling, restarting, debouncing, queueing, and checking the standing of async operations.
But in a posh, data-rich utility, this stuff usually emerge as requirements.
It is a aid to have a concise and readable method of dealing with these behaviors.

One other factor I like about ember-concurrency is that once I learn the documentation, it helps me to judge whether or not the code I’ve written can stand up to deviations from the glad path – impatient customers, gradual API requests, and interrupted animations.

The enjoyment it brings me is that it retains my code tidy and resilient. I can spend extra of my time engaged on interfaces and interactions, with out littering my code with issues like an array of guarantees and booleans to trace their resolved states.

This addon is Octane-ready. For builders who’re utilizing Ember Octane or Native Courses, ember-concurrency-decorators offers decorator syntax for duties, which is not strictly crucial, however it seems to be nicer.

Do you employ this addon? Or one prefer it? We would love to listen to about Ember addons that deliver you pleasure!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments