Coder Social home page Coder Social logo

Comments (6)

strugee avatar strugee commented on August 23, 2024 1

It's also possible this is the wrong layer to provide this at - it might make more sense to have a wrapper at the Flagsmith React integration layer that used this proposed behavior. The idea being that hey, use this React integration wrapper because it makes it easy to deal with this network side effect thing in the context of a React app.

from flagsmith-js-client.

dabeeeenster avatar dabeeeenster commented on August 23, 2024

Maybe this should behaviour should be configurable? It would be a major breaking change if we made it default behaviour...

from flagsmith-js-client.

strugee avatar strugee commented on August 23, 2024

It would be a major breaking change if we made it default behaviour...

Hmm, how so? I mean, I suppose if you're relying on this side effect instead of just calling getFlags() you'd be broken... but why would you do that in the first place?

from flagsmith-js-client.

dabeeeenster avatar dabeeeenster commented on August 23, 2024

It's also possible this is the wrong layer to provide this at - it might make more sense to have a wrapper at the Flagsmith React integration layer that used this proposed behavior. The idea being that hey, use this React integration wrapper because it makes it easy to deal with this network side effect thing in the context of a React app.

Q for @kyle-ssg and @novakzaballa !

from flagsmith-js-client.

kyle-ssg avatar kyle-ssg commented on August 23, 2024

I don't think the React layer is the right place to do it, as the suggested behaviour has nothing to do with React. If we were to make any changes I think it'd be part of the core library.

Making identify skip the API makes sense, the only use-case I think is weird would be if the identity was the same due to local storage cache rather than a previous API response. That's the only part I'd see as a nasty breaking change.

from flagsmith-js-client.

kyle-ssg avatar kyle-ssg commented on August 23, 2024

Reading through this a bit more, I think that we should not pursue with this change. As documented, calling identify fetches flags for the identity and people may expect it to do so regardless of current state.

What's less common is the desired outcome of this ticket, I think this can easily be achieved by wrapping the identify calls in if(flagsmith.identity!=='x')....

If it comes to light that this is a common use case I think we should reconsider of course.

from flagsmith-js-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.