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.

Advertisements
This entry was posted in Tech bits, Web development and tagged . Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s