dsuryd / dotNetify

Simple, lightweight, yet powerful way to build real-time web apps.
https://dotnetify.net
Other
1.17k stars 164 forks source link

no $dispatch in vm #313

Closed HengzheLi closed 2 years ago

HengzheLi commented 2 years ago

I used below code to get a 'vm' object

const { contentItemId } = useParams();
  const { vm, state } = useConnect(vmName, { PriceTickList: []})
  // React.useEffect(()=>{
  //     vm.$dispatch({ Init: { contentItemId: contentItemId }})
  // },[])
  console.info(vm)

But there is no $dispatch property in the returned vm. Below is the printed content of vm image

dsuryd commented 2 years ago

It should be listed under [[Prototype]]: Object. And you should check that vm is non-null before it's referenced.