1+ import * as s from 'solid-js'
12import { throttle } from '@solid-primitives/scheduled'
23import { defer } from '@solid-primitives/utils'
3- import { type Accessor , createEffect , createMemo } from 'solid-js '
4+ import { msg } from '@ solid-devtools/shared/utils '
45import { DevtoolsMainView , NodeType } from '../main/constants.ts'
56import { ObjectType , getObjectById } from '../main/id.ts'
67import { type NodeID , type Solid } from '../main/types.ts'
@@ -13,8 +14,8 @@ export {type SerializedDGraph} from './collect.ts'
1314export type DGraphUpdate = SerializedDGraph . Graph | null
1415
1516export function createDependencyGraph ( props : {
16- enabled : Accessor < boolean >
17- inspectedState : Accessor < InspectedState >
17+ enabled : s . Accessor < boolean >
18+ inspectedState : s . Accessor < InspectedState >
1819 onNodeUpdate : ( nodeId : NodeID ) => void
1920 emit : OutputEmit
2021} ) {
@@ -30,7 +31,7 @@ export function createDependencyGraph(props: {
3031 } )
3132 }
3233
33- const inspectedNode = createMemo ( ( ) => {
34+ const inspectedNode = s . createMemo ( ( ) => {
3435 const state = props . inspectedState ( )
3536
3637 if ( state . signalId ) {
@@ -57,19 +58,19 @@ export function createDependencyGraph(props: {
5758 type === NodeType . Context
5859 ) {
5960 clearListeners = null
60- props . emit ( 'DgraphUpdate' , null )
61+ props . emit ( msg ( 'DgraphUpdate' , null ) )
6162 return
6263 }
6364
6465 const dgraph = collectDependencyGraph ( node as Solid . Computation | Solid . Signal , {
6566 onNodeUpdate,
6667 } )
6768 clearListeners = dgraph . clearListeners
68- props . emit ( 'DgraphUpdate' , dgraph . graph )
69+ props . emit ( msg ( 'DgraphUpdate' , dgraph . graph ) )
6970 }
7071 const triggerInspect = throttle ( inspectDGraph , 200 )
7172
72- createEffect (
73+ s . createEffect (
7374 defer ( [ props . enabled , inspectedNode ] , ( ) => {
7475 queueMicrotask ( inspectDGraph )
7576 } ) ,
0 commit comments