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

Implement a JavaScript is_enabled() function #14

Open
peterhartree opened this issue Oct 18, 2018 · 3 comments
Open

Implement a JavaScript is_enabled() function #14

peterhartree opened this issue Oct 18, 2018 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@peterhartree
Copy link
Contributor

Often feature changes involve PHP and JavaScript changes. It'd be useful to be able to call is_enabled('flag_key') via JavaScript as well.

@peterhartree peterhartree changed the title Implement an is_enabled() function that can be used to check flag status from JavaScript Implement a JavaScript is_enabled() function Oct 18, 2018
@jamesrwilliams
Copy link
Owner

This is a great idea. Something like this perhapse:

if ( featureFlags.is_enabled( 'foo') ) { /* Feature specific JS */ } 

@jamesrwilliams jamesrwilliams added the enhancement New feature or request label Oct 18, 2018
@jamesrwilliams
Copy link
Owner

Just making a note that this should inherit the function name we decide to implement/update in #15.

@jamesrwilliams
Copy link
Owner

Potentially a separate issue but we should also consider how this can be used within WordPress's new Gutenberg blocks.

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

No branches or pull requests

2 participants