I am trying to create hierarchical result with callbacks.
This is my function structure:
el('root', function(){
el('users', function(){
el('show');
});
el('products');
});
The result I want is:
assert.equal(result, [ 'root', 'root_users', 'root_users_show', 'root_products' ] );
I got pretty far in my implementation: http://jsfiddle.net/5ur5u/ The problem I have is that I am increasing my depth each time el is called. It works fine until it reaches products. Because show puts depth on 3 it means that products will be added at the end of show.
So if anybody can give me a hand or point me into the right direction that would be great.
This does what you are asking for