Skip to content

Commit

Permalink
tweak: support edge runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Mar 6, 2024
1 parent 03a16fb commit 46eec3e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utils/getFrameContext.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isAsyncFunction } from 'node:util/types'
import type { Context, FrameContext } from '../types/context.js'
import type { Env } from '../types/env.js'
import { getIntentState } from './getIntentState.js'
Expand Down Expand Up @@ -68,7 +67,7 @@ export function getFrameContext<
if (cycle === 'image') return state as _state

const clone = structuredClone(previousState)
if (isAsyncFunction(derive))
if ((derive as any)[Symbol.toStringTag] === 'AsyncFunction')
return (derive(clone as _state) as any).then(() => {
previousState = clone
return previousState
Expand Down

0 comments on commit 46eec3e

Please sign in to comment.