
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
aurelia-async-binding
Advanced tools
Aurelia async bindingbehavior to consume Observables and Promises
An Aurelia binding behavior to consume async streams and promises directly from within your templates.
Install the npm dependency via
npm install aurelia-async-binding
In your main.ts
you'll have to register the plugin which makes it globally available:
import {Aurelia} from 'aurelia-framework'
import environment from './environment';
export function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.feature('resources');
...
aurelia.use.plugin("aurelia-async-binding"); // <----- REGISTER THE PLUGIN
aurelia.start().then(() => aurelia.setRoot());
}
completedHandler
for once the stream completeserror
handlers to react on streamed errorsOnce the plugin is installed and configured you can use the async
binding behavior.
An example VM and View can be seen below:
import { Observable } from 'rxjs/Observable';
import "rxjs/add/operator/map";
import "rxjs/add/operator/take";
import "rxjs/add/observable/interval";
import "rxjs/add/observable/of";
import "rxjs/add/observable/from";
interface SPAFramework {
label: string;
url: string;
}
export class App {
public frameworks: Observable<SPAFramework[]>;
public frameworkOverTime: Observable<SPAFramework>;
public isSequenceDone: boolean = false;
constructor() {
const data: SPAFramework[] = [
{ label: "Aurelia", url: "http://aurelia.io" },
{ label: "Angular v4", url: "http://angular.io" },
{ label: "React", url: "https://facebook.github.io/react/" },
];
this.frameworks = Observable.of(data);
this.frameworkOverTime = Observable.interval(2000)
.map((idx) => data[idx])
.take(data.length);
}
public completedHandler = () => {
setTimeout(() => this.isSequenceDone = true, 2000);
}
}
<template>
<h1>SPA Frameworks</h1>
<ul>
<li repeat.for="framework of frameworks & async">
<a href="${framework.url}">${framework.label}</a>
</li>
</ul>
<h1>Frameworks streamed (plucked property)</h1>
<div>
${frameworkOverTime & async: { property: 'label' }}
</div>
<h1>Frameworks streamed (with binding, completed handler)</h1>
<div with.bind="frameworkOverTime & async: { completed: completedHandler }">
<a if.bind="!isSequenceDone" href="${url}">${label}</a>
<span if.bind="isSequenceDone">Sequence is done!</span>
</div>
</template>
Thanks goes to Dwayne Charrington for his Aurelia-TypeScript starter package https://github.com/Vheissu/aurelia-typescript-plugin
FAQs
Aurelia async bindingbehavior to consume Observables and Promises
The npm package aurelia-async-binding receives a total of 20 weekly downloads. As such, aurelia-async-binding popularity was classified as not popular.
We found that aurelia-async-binding 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
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.