Skip to content

Consider using wp.data layer instead of custom event dispatch #50

@mcsf

Description

@mcsf

Hello.

Given the heavy investment in WordPress's data module, especially in the context of the development of the Block Editor, has it been considered for supporting for the Consent API's client-side interface?

Stores under wp.data support subscribe, select and dispatch. There are a couple of benefits to it, from useful deprecation mechanisms for backwards compatibility, to the fact that consumers of the API may choose to consume it via a traditional "subscribe and dispatch" design, or declaratively from within wp.element-powered UIs (cf. useSelect). There are also affordances in place for client-side persistence of preferences.

Of course, the drawback to consider is the addition of dependencies.

I'm interesting in hearing how you weigh this approach against the current event-based one.

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