-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
I am using this library with nodecache as below.
import nodecache from "node-cache";
const flagsmith = new Flagsmith({
environmentKey: "xxx",
cache: new nodecache({
stdTTL: 10,
checkperiod: 10,
}),
});
export default flagsmith;
I get the following type error on cache:
Type 'NodeCache' is not assignable to type 'FlagsmithCache'.
The types returned by 'get(...)' are incompatible between these types.
Type 'Promise<Flags> | undefined' is not assignable to type 'Promise<Flags>'.
Type 'undefined' is not assignable to type 'Promise<Flags>'.
I wonder if this is a problem with the Flagsmith Types? It seems to make sense that the get method will return undefined when the key does not exist in the cache.
Metadata
Metadata
Assignees
Labels
No labels