News for hackers. Stuff that matters.
Re:Ask HN: Do you have a guide on how to use feature flags? by swah on Monday April 04, 2022 @07:12AM (#30905256)
The idea is that for some particular new feature/behaviour/optimization your application has, instead of just coding it, code it in a way that can be disabled easily:

For example, I have some projects using using redux-saga, I'll do something like:

    if (env.EnableSomeNewThing) {
        yield fork(saga1)
    }
So this behavior can be enabled/disabled using an env variable instead of commenting/reverting code from Git. Of course this could also be more sophisticated: enable via configuration, enable for a sample of the users, or premium users...

There are no comments on this comment yet.