Skip to content

Commit

Permalink
feat: add null to possbile values of of id-type of useGet (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
anbraten authored Aug 6, 2021
1 parent ea606a2 commit 8a5111f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/useGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function loadServiceEventHandlers<
M,
>(
service: FeathersService<CustomApplication, ServiceTypes<CustomApplication>[T]>,
_id: Ref<Id | undefined>,
_id: Ref<Id | undefined | null>,
data: Ref<M | undefined>,
): () => void {
const onCreated = (item: M): void => {
Expand Down Expand Up @@ -64,13 +64,13 @@ export type UseGetFunc<CustomApplication> = <
M = ServiceModel<CustomApplication, T>,
>(
serviceName: T,
_id: Ref<Id | undefined>,
_id: Ref<Id | undefined | null>,
) => UseGet<M>;

export default <CustomApplication extends Application>(feathers: CustomApplication) =>
<T extends keyof ServiceTypes<CustomApplication>, M = ServiceModel<CustomApplication, T>>(
serviceName: T,
_id: Ref<Id | undefined>,
_id: Ref<Id | undefined | null>,
{ disableUnloadingEventHandlers } = { disableUnloadingEventHandlers: false },
): UseGet<M> => {
const data = ref<M>();
Expand Down

0 comments on commit 8a5111f

Please sign in to comment.