bandiera icon indicating copy to clipboard operation
bandiera copied to clipboard

optional arbitrary content returned instead of booleans

Open ettomatic opened this issue 8 years ago • 1 comments

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?

ettomatic avatar Apr 05 '16 13:04 ettomatic

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.

dazoakley avatar Apr 11 '16 13:04 dazoakley