Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ronas-it/rtkq-entity-api",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"description": "Wrapper utilities for CRUD operations with REST APIs entities using RTK Query",
"license": "MIT",
"author": "Ronas IT",
Expand Down
1 change: 0 additions & 1 deletion src/create-entity-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
* @param {((pagination: Pagination, request: TSearchRequest) => number) | undefined} [options.getCurrentPage=((pagination) => pagination.currentPage)] - The function to get current page.
* @returns {Omit<EntityApi<TEntity, TSearchRequest, TEntityRequest, TSearchResponse, typeof omitEndpoints>, keyof EntityApiCustomHooks> & EntityApiCustomHooks<TEntity, TSearchRequest, TSearchResponse>} The entity API.
*/

export function createEntityApi<
TEntity extends BaseEntity,
TSearchRequest extends PaginationRequest = PaginationRequest,
Expand Down
3 changes: 3 additions & 0 deletions src/types/custom-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ export type EntityApiCustomHooks<
TSearchRequest extends PaginationRequest = PaginationRequest,
TSearchResponse extends PaginationResponse<TEntity> = PaginationResponse<TEntity>,
> = {
/**
* @deprecated This hook will be removed. Instead, use 'useSearchPaginatedInfiniteQuery' hook in your entity API
*/
useSearchInfiniteQuery: ReturnType<typeof createInfiniteQueryHook<TEntity, TSearchRequest, TSearchResponse>>;
};
2 changes: 1 addition & 1 deletion src/types/entity-api-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export type EntityApiUtils<
*/
handleEntityUpdate: (
arg: EntityPartial<TEntity> | TEntity['id'],
endpointLifecycle: LifecycleApi<EntityPartial<TEntity>, EntityPartial<TEntity> | TEntity['id']>,
endpointLifecycle: LifecycleApi<EntityPartial<TEntity> | void, EntityPartial<TEntity> | TEntity['id']>,
options?: {
optimistic?: boolean;
shouldRefetchEntity?: boolean;
Expand Down