Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
packages/core/src/index.ts
Outdated
| > { | ||
| private log = (...args: any[]) => | ||
| this.config.debug ? console.log(`core.Abby`, ...args) : () => {}; | ||
| this.config.debug ? console.log(`core.Abby`, ...args) : () => { }; |
There was a problem hiding this comment.
We dont have a proper logger integrated right now , so is this used to log info in debugging mode atm.
| * helper function to make testing easier | ||
| */ | ||
| refetchFlags() { | ||
| this.loadProjectData(); |
There was a problem hiding this comment.
| this.loadProjectData(); | |
| return this.loadProjectData(); |
There was a problem hiding this comment.
loadProjectData() has return type void.
packages/core/src/index.ts
Outdated
| if (!flagTime) return this.#data.flags[key]; | ||
| const now = new Date(); | ||
| if (flagTime.getTime() <= now.getTime()) { | ||
| this.refetchFlags() |
There was a problem hiding this comment.
this is async.. so without waiting the return down below may be old though 🤷
Co-authored-by: slaesh <55546823+slaesh@users.noreply.github.com>
…tryabby/abby into feat/core/addFeatureFlagCaching
| private testDevtoolOverrides: Map<keyof Tests, Tests[keyof Tests]["variants"][number]> = | ||
| new Map(); | ||
|
|
||
| private flagDevtoolOverrides: Map<FlagName, boolean> = new Map(); |
There was a problem hiding this comment.
guess this shouldn't be "just booleans" anymore, right?
the fix should be another PR :)
| * @param key name of the featureflag | ||
| * @returns value of flag | ||
| */ | ||
| getValidFlag<F extends FlagName>(key: F, refetch: boolean | undefined) { |
There was a problem hiding this comment.
this may break every call in every lib. if this is not intended, maybe do refetch?: boolean instead. :)
|
I honestly feel like this feature is kinda against our business model :D We potentially want as many requests against our API so we can charge for that. I personally think that if users want to avoid this, they can cache it themselves in memory and live with stale data |
Feature flags are cached by the core and refetched if expired.