Call jsRender method on load and on resize
<p>I am checking the device width and showing some option in menu. I need to check this while page loading and resizing. Because I need to check in devices in portrait and landscape view.</p>

<pre><code>&lt;script type="text/x-jsrender" id="option"&gt;
&lt;ul class="dropdown-menu" role="menu"&gt;
{{if ~checkDevice()}}
        &lt;li&gt;
                &lt;span class="btn"&gt;&lt;/span&gt;
                Show
        &lt;/li&gt;
{{/if}}
&lt;script type="text/javascript" language="javascript"&gt;
$(document).ready(function () {
$.views.helpers({
        checkDevice: function () {
            return window.innerWidth &gt; 450;
        }
    });
});
</code></pre>

<p>This working correctly in on load. How to check this if condition on resize ?</p>