
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
angular-form-status-workaround
Advanced tools
Workaround for an Angular form bug with async validators
Angular forms can sometimes be stuck pending as described in https://github.com/angular/angular/issues/13200 and https://github.com/angular/angular/issues/14542.
This RxJS operator provides a temporary workaround until this issue is fixed upstream. When the bug is fixed, this library will be deprecated.
Example usage
import { fixFormStatus } from 'angular-form-status-workaround';
form.statusChanges.pipe(
fixFormStatus(form),
).subscribe(s => {
// WILL emit when the async validators complete and not stay stuck at PENDING
});
This operator can also be used on any subclass of AbstractControl.
It is also possible to state the rate at which the status will be checked by
passing the time in milliseconds as a second argument. Example:
fixFormStatus(form, 100)
. The default rate is 250ms.
statusChanges
like valueChanges
returns an observable that does not complete. You must
unsubscribe to avoid memory leaks and unwanted behavior. This can be achieved using takeUntil
and
takeWhile
.
Only get notified when status is no longer pending.
this.form.statusChanges.pipe(
fixFormStatus(this.form),
takeWhile(status => status === 'PENDING', true),
last(),
).subscribe(() => {
// Emits once when status is no longer pending, then completes
});
FAQs
Workaround for an Angular form bug with async validators
The npm package angular-form-status-workaround receives a total of 11 weekly downloads. As such, angular-form-status-workaround popularity was classified as not popular.
We found that angular-form-status-workaround demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.