Js after the subscription ready

i have a simple js
Template.home.rendered = function() {
$(’.isotope’).isotope({
itemSelector: ‘.carta’,
masonry: {
gutter: 0
}
});
};

and i need to execute before the subscription is ready, i try to use in the blaze

 {{#if Template.subscriptionsReady}}
     <div class="isotope">>               
         {{#each recorrerArray}}
             <div class="{{this.ancho}} carta" data-mH="{{this.ancho}}"  >
                <div class="editar">
                     <a href="/editar/{{this.tabla}}/{{this._id}}"><i class="fa fa-pencil"></i></a>
                </div>
                <a href="/{{this.tabla}}/{{this._id}}"><img src="uploads/{{this.imagen}}" alt="{{this.nombre}}"/></a>
             </div>
         {{/each}}
     </div>
{{else}}
     loading...
 {{/if}}

but always the js is before the helper is render and the .isotope div is empty, how can solve this?

make .isotope separate template

and execute that JS in .onRendered function.

i try this, and I WORK! but i don’t use .onRendered, i use rendered directly

I try to keep away from deprecated commands

I thought it was the onRendered is the deprecated commands, i need to read the actual documentation