Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is ko.applyBindings synchronous or asynchronous?

Does the generated view exists right after you call ko.applyBindings() or does the scaffolding happen asynchronously?

Thanks!

like image 365
vtortola Avatar asked Jan 16 '13 15:01

vtortola


1 Answers

ko.applyBindings is a synchronous call.

There may be cases where bindings have special code to do things in a setTimeout, but this is not generally the case.

With the addition of components in Knockout 3.2, components are asynchronous. With Knockout 3.3, there will be an option to render components synchronously if the viewmodel / template is loaded.

like image 93
RP Niemeyer Avatar answered Sep 29 '22 22:09

RP Niemeyer