diff --git a/readme.md b/readme.md index 547df1b..015475c 100644 --- a/readme.md +++ b/readme.md @@ -193,7 +193,9 @@ You can load multiple DataLoaders in a single page. Each `DataLoader` will fetch ### Params hashing -Behind the scenes the data loader uses a library called `hash-sum` to create hashes of the parameter object. You can override it on the DataProvider +Behind the scenes the data loader uses a library called `hash-sum` to create hashes of the parameter object. You can control which of the data loader params are taken into account by specifying the cache keys (similar to React hooks). + +You can override the hashing function on the DataProvider if you have issues with the inbuilt library. ## More info diff --git a/src/data-provider.tsx b/src/data-provider.tsx index 646f4c9..e70d360 100644 --- a/src/data-provider.tsx +++ b/src/data-provider.tsx @@ -14,7 +14,7 @@ export interface Props { isServerSideRender?: boolean resources: DataLoaderResources globalProps?: object - /** Override the object hasing function */ + /** Override the object hashing function */ objectHash?: ObjectHash } @@ -26,7 +26,7 @@ export class DataLoaderProvider extends React.Component { this.dataLoader = new DataLoaderStoreAndLoader( // tslint:disable-next-line:no-empty - this.props.onEvent || (() => {}), + this.props.onEvent || (() => { }), this.props.initialState, params => { const dataLoader = this.props.resources.getResourceLoader(params.resourceType)