akdubya / dustjs

Asynchronous templates for the browser and node.js
http://akdubya.github.com/dustjs/
MIT License
1.44k stars 131 forks source link

Asynchronous context data #11

Open wvl opened 13 years ago

wvl commented 13 years ago

I might be missing something, but is there a way to asynchronously add data to the context?

For your "{#list:projects}" example -- if the projects object was returned from an asynchronous function -- is that workable somehow?

xonecas commented 13 years ago

You can wait for the calback to call render(), you can either pass the data thats not aynchronous via global var or by closure, and them merge it with the new data returned from the async call. This way you should be able to render async data.