TriFrost

TriFrost 1.1.0

|peterver

News

Improved

  • dx: @cache decorator and cacheFn helper now support partial argument key functions, allowing key generators to use only a subset of parameters. This improves flexibility without losing type safety
@cache((ctx, userId) => `user:${userId}`)
async getUser(ctx: Context, userId: string, includeMeta = false) {
  ...
}

const fn = cacheFn((ctx, userId) => `user:${userId}`)(
  async (ctx:Context, userId:string, includeMeta:boolean) => {
    ...
  }
);
  • dx: TriFrostRedis, the provider shim type used inside of the RedisCache now has its set and del return type set as Promise<unknown> instead of Promise<void>

Loved the read? Share it with others