Knockout performance tip

KOLogo As our SPA app grows we need to be more conscious of browser performance.

One handy way is to keep the DOM tree light(er). Knockout offers an easy way to remove unused DOM fragments: By using the ko:if binding – instead of the ko:visible binding.

On the UI both of them serve to show/hide widgets. The difference is that the, if binding removes DOM elements if they are not being displayed as opposed the visible binding which only toggles visibility. Official docs.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s