Skip to content

Commit

Permalink
feat: Include instance and window on HookOptions (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Nov 17, 2022
1 parent 8fce150 commit d456fe1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ export interface HookOptions {
continue: Symbol;
nodeName: string | undefined;
constructor: string | undefined;
instance: WorkerInstance;
window: Window;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/lib/web-worker/worker-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
cachedStructure,
dimensionChangingMethodNames,
dimensionChangingSetterNames,
environments,
HookContinue,
HookPrevent,
InstanceDataKey,
Expand Down Expand Up @@ -254,4 +255,6 @@ const createHookOptions = (instance: WorkerInstance, applyPath: ApplyPath): Hook
continue: HookContinue,
nodeName: (instance as any as WorkerNode)[InstanceDataKey],
constructor: getConstructorName(instance),
instance,
window: environments[instance[WinIdKey]].$window$,
});

1 comment on commit d456fe1

@vercel
Copy link

@vercel vercel bot commented on d456fe1 Nov 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.