Comments (6)
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.
Maybe this should behaviour should be configurable? It would be a major breaking change if we made it default behaviour...
from flagsmith-js-client.
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.
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.
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.
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)
- isLoading never updates to false HOT 2
- Flagsmith's `loadingState.error` is not respect actual error state HOT 11
- [Bug] - NextJS >= 13.0.0 SSR `useFlagsmith` state not matching the state that is passed to the provider. HOT 16
- flagsmith/react only works in React 18 HOT 3
- [Bug] - TypeError: Cannot read properties of null (reading 'getValue') HOT 5
- Flagsmith's 'useFlags' doesn't return actual cached flags when request failed HOT 2
- Rollup Name for react HOT 5
- Inconsistent license information HOT 2
- Caching with multiple instance doesn't work HOT 6
- Typing issue in react.tsx: 'flagsmith' is possibly 'null' HOT 3
- useFlags() race condition HOT 8
- Different environments not working HOT 5
- Localstorage cache is not being wiped out in some edge cases HOT 3
- Support `getValue` fallback without `json` flag HOT 2
- useFlags not updating values in react18/Nextjs App Router HOT 1
- 3.23.0 seems to have broken something HOT 4
- Intermittent Flakiness in Feature Flags on Safari/MacOS HOT 2
- Flags are null when the cacheFlags option is true HOT 3
- Typescript compiler errror `Cannot find name 'F'.` when compiling flagsmith in Angular project HOT 3
- Bundle ES(flagsmith-es) and combine with standard CJS module (flagsmith)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flagsmith-js-client.