Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/async-binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ export class asyncBindingBehavior {
: () => { binding.originalupdateTarget(options && options.property ? this.getPropByPath(options.error, options.property) : options.error); }
: undefined;

// Immediately update the target if the Observable has a BehaviorSubject-like current value member
if ("value" in a) {
binding.originalupdateTarget((a as any).value)
} else if (typeof (a as any).getValue === "function") {
binding.originalupdateTarget((a as any).getValue())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does that really make a difference? I mean if you subscribe to a BehaviorSubject the subscription will fire right away with the current value.

}

binding._subscription = a.subscribe(
(res) => {
binding.originalupdateTarget(options && options.property ? this.getPropByPath(res, options.property) : res);
Expand Down