Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the current koa context to templateOptions.data to provide access within helpers #24

Merged
merged 1 commit into from Oct 29, 2014
Merged

Conversation

shellscape
Copy link
Contributor

We had a specific need to access the current koa request context within nearly all of our helpers. This provides useful access to that information within custom helpers.

I'm open to other naming options other than data.koa but it seemed most appropriate given that context has a different meaning in handlebars, once you're in that land.

@jwilm
Copy link
Collaborator

jwilm commented Oct 3, 2014

Why wouldn't you just pass the context in as needed? Why not just attach it in higher in the call chain?

@shellscape
Copy link
Contributor Author

A higher call in the chain... where? Believe me, I tried everything I could to get the context in there at the right time. This was the only solution that worked.

I'm all for some more discussion, but this is currently a blocker for us. As there's no detriment to this very small addition, can I get a merge on it?

@shellscape
Copy link
Contributor Author

20 days have passed since the last comment. Is this project just not being maintained frequently?

@jwilm
Copy link
Collaborator

jwilm commented Oct 29, 2014

Hi Shellscape, sorry I missed your reply 3 weeks ago. I was trying to reduce email notifications coming from GitHub and inadvertently stopped getting them for this repo 😐. Let's just merge this in for now. Maybe we can add a config flag in the future to toggle this behavior.

jwilm added a commit that referenced this pull request Oct 29, 2014
Add the current koa context to templateOptions.data to provide access within helpers
@jwilm jwilm merged commit a7aad99 into koajs:master Oct 29, 2014
@shellscape
Copy link
Contributor Author

👍 thanks very much, and no worries. Glad you saw the notification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants