Skip to content

Commit

Permalink
chore: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
anubra266 committed Sep 19, 2024
1 parent 7d6abca commit c8a8234
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions examples/qwik-ts/src/hooks/use-service.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import { NoSerialize, noSerialize, useComputed$, useStore, useVisibleTask$ } from "@builder.io/qwik"
import type { Machine, StateMachine as S } from "@zag-js/core"

interface UseServiceOptions<
TContext extends Record<string, any>,
TState extends S.StateSchema,
TEvent extends S.EventObject,
> {
qrl: () => Promise<NoSerialize<Machine<TContext, TState, TEvent>>>
initialState: NoSerialize<S.State<TContext, TState>>
}
import { UseMachineOptions } from "~/hooks/types"

export function useService<
TContext extends Record<string, any>,
TState extends S.StateSchema,
TEvent extends S.EventObject,
>(props: UseServiceOptions<TContext, TState, TEvent>, options?: S.HookOptions<TContext, TState, TEvent>) {
>(props: UseMachineOptions<TContext, TState, TEvent>, options?: S.HookOptions<TContext, TState, TEvent>) {
const { qrl, initialState } = props
const { state: hydratedState, context } = options ?? {}

Expand Down

0 comments on commit c8a8234

Please sign in to comment.