expressjs / express-expose

Expose raw js, objects, and functions to the client-side (awesome for sharing utils, settings, current user data etc)
MIT License
299 stars 26 forks source link

Fix Request-Level exposure. #27

Closed jonpacker closed 12 years ago

jonpacker commented 12 years ago

locals was only being called on the request level if something on the same namespace had not been previously exposed globally - and even then, it was being called before the value itself had been saved. I moved the locals call to after the values have been transformed/saved, and made sure it is called every time for request-level calls to expose.

The only way around this would be to delay calling locals until right before the template is rendered. I couldn't see any obvious way of doing that.

tj commented 12 years ago

thanks!