dsuryd / dotNetify

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

typescript typings missing dotnetifyVM.$routeTo #240

Closed Spongman closed 4 years ago

Spongman commented 4 years ago

is this deprecated?

dsuryd commented 4 years ago

It's not; the typed definition is not complete.

Spongman commented 4 years ago

what about IConnectionOptions? https://dotnetify.net/core/api/routing#setting-up-route-links has this:

const onRouteEnter = (path, template) => template.Target = "Content"; 
this.vm = dotnetify.react.connect("Index", this, { onRouteEnter });

but IConnectOptions doesn't have an onRouteEnter.

it's not entirely clear to me that the above code would work if it did...

dsuryd commented 4 years ago

Next version will have better Typescript support. Until then, see the code in this branch for up-to-date typings: https://github.com/dsuryd/dotNetify/blob/Typescript/DevApp/src/dotnetify/_typings/index.ts

Spongman commented 4 years ago

i think probably those docs should be changed to use the this.vm.onRouteEnter = ... variant.

dsuryd commented 4 years ago

Updated typings in v4. There are breaking changes from renamed types.