Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Custom event during parsing template #347

Open
AdelineCaro opened this issue Jul 8, 2022 · 2 comments · May be fixed by #348
Open

Custom event during parsing template #347

AdelineCaro opened this issue Jul 8, 2022 · 2 comments · May be fixed by #348

Comments

@AdelineCaro
Copy link

Hello,

Firstly I want to thank you for sharing this awesome project.

Then I really like to be able to add custom events in my custom fetchTemplate function, and catch them like other tailor event.

I explain the context :
I got templates containing fragments. Those templates are made of "old scaring legacy code", and have there "own live" : they can add cookies or other stuff.
I have a custom fetchTemplate with an axios method to get my template. On axios call, I can access all my template response header, including set-cookie, filled by my template.
I want go transmit this cookie header to my rendered page.
That's why I think about using events, as tailor does.

My issue is that I can't create an event emitter that I can pass to my fetchTemplate.

I see a solution : add tailor instance as argument to fetchTemplate function ? (it is in request-handler.js file)

Do you think it's possible ?

I can create a pull request if you want.

I hope I'm clear enough,
Thanks for reading ;)

AdelineCaro added a commit to i-Run/tailor that referenced this issue Jul 26, 2022
- by adding tailor object (event emitter) as third parameter of  function

fix zalando#347
@AdelineCaro
Copy link
Author

I do a pull request for this issue : #348, with test and doc updates.

Can someone look at it ?

@AdelineCaro
Copy link
Author

Hey there !

Is this repo is still alive ?

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

Successfully merging a pull request may close this issue.

1 participant