Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

optional arbitrary content returned instead of booleans #70

Open
ettomatic opened this issue Apr 5, 2016 · 1 comment
Open

optional arbitrary content returned instead of booleans #70

ettomatic opened this issue Apr 5, 2016 · 1 comment

Comments

@ettomatic
Copy link
Contributor

We are using Bandiera for our A/B tests.
It'd be useful to have an option that allow us to map true/false return values with some arbitrary content, something like this at the bottom of the admin feature form:

Retuned values
Do you want to return some content instead of true/false?

Value returned when true (it can be an integer, a string, valid Json, etc)
[TEXTAREA]
Value returned when false (it can be an integer, a string, valid Json, etc)
[TEXTAREA]

This would allow us to avoid to perform this using conditionals in our code, some usage examples:

{ 'experiment-minimum-read' :  4 | 5 }

or even some Json

{ experiment-box-labels: 
    { 'title': 'abc', 'desc': 'xyz'} | { 'title': 'def', 'desc': '123'}
}

Thoughts?

@dazoakley
Copy link
Contributor

Hi ya,

I've been thinking about something similar to this for a little while too, but rather than just returning an arbitrary string based on true/false we could support more than just boolean "states" for a feature... i.e. you could have states like "RED", "BLUE", "GREEN" or "YELLOW".

Updating the interface with the client libraries (i.e. fallbacks upon error), for the .enabled? method we could allow the passing through a default fallback. But the bigger challenge I could see would possibly be the usage model of % groups and user groups - maybe we'd need to flesh this out a bit more?

Really that feels like something that shouldn't be in Bandiera and should be something within the calling app, (the values based on the true/false response), but maybe i'm not getting the use case you're trying to meet.

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

No branches or pull requests

2 participants