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

Custom event during parsing template #347

@AdelineCaro

Description

@AdelineCaro

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 ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions