Skip to content

Commit 8a5111f

Browse files
authored
feat: add null to possbile values of of id-type of useGet (#35)
1 parent ea606a2 commit 8a5111f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/useGet.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function loadServiceEventHandlers<
99
M,
1010
>(
1111
service: FeathersService<CustomApplication, ServiceTypes<CustomApplication>[T]>,
12-
_id: Ref<Id | undefined>,
12+
_id: Ref<Id | undefined | null>,
1313
data: Ref<M | undefined>,
1414
): () => void {
1515
const onCreated = (item: M): void => {
@@ -64,13 +64,13 @@ export type UseGetFunc<CustomApplication> = <
6464
M = ServiceModel<CustomApplication, T>,
6565
>(
6666
serviceName: T,
67-
_id: Ref<Id | undefined>,
67+
_id: Ref<Id | undefined | null>,
6868
) => UseGet<M>;
6969

7070
export default <CustomApplication extends Application>(feathers: CustomApplication) =>
7171
<T extends keyof ServiceTypes<CustomApplication>, M = ServiceModel<CustomApplication, T>>(
7272
serviceName: T,
73-
_id: Ref<Id | undefined>,
73+
_id: Ref<Id | undefined | null>,
7474
{ disableUnloadingEventHandlers } = { disableUnloadingEventHandlers: false },
7575
): UseGet<M> => {
7676
const data = ref<M>();

0 commit comments

Comments
 (0)