Skip to content

Consider exposing formatters and utilities to a global variable #470

@martincpt

Description

@martincpt

User Story

As a developer, I want to listen for my theme's events—such as 'add to cart' and 'remove from cart'—and send them to Google Analytics.

From what I can tell, your plugin provides solutions for most of this, but they are unavailable inside an anonymous function.

More specifically, by making data formatters and utilities available under the global scope, developers like me could easily integrate these functions into our themes without having to redefine them.

Desired Solution

Expose the formatters and utilities as global variables or have the anonymous function return these objects, making them accessible.

Unknowns

As far as I can see, the source code uses React. I’m not sure if or how this affects the feasibility of the proposed solution.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions