Skip to content

Commit

Permalink
Default data source loadparam type should be string (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
kibertoad authored Jan 6, 2025
1 parent 7110162 commit 1191da4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/types/DataSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ export interface GroupCache<LoadedValue> extends GroupWriteCache<LoadedValue> {
getExpirationTimeFromGroup: (key: string, group: string) => Promise<number | undefined>
}

export interface DataSource<LoadedValue, LoadParams = undefined> {
export interface DataSource<LoadedValue, LoadParams = string> {
get: (loadParams: LoadParams) => Promise<LoadedValue | undefined | null>
getMany: (keys: string[], loadParams?: LoadParams) => Promise<LoadedValue[]>

name: string
}

export interface GroupDataSource<LoadedValue, LoadParams = undefined> {
export interface GroupDataSource<LoadedValue, LoadParams = string> {
getFromGroup: (loadParams: LoadParams, group: string) => Promise<LoadedValue | undefined | null>
getManyFromGroup: (keys: string[], group: string, loadParams?: LoadParams) => Promise<LoadedValue[]>

Expand Down

0 comments on commit 1191da4

Please sign in to comment.