routify.dev icon indicating copy to clipboard operation
routify.dev copied to clipboard

Documentation - $afterPageLoad (callback) requires a return value of boolean, but doc does not state so

Open Tommertom opened this issue 3 years ago • 0 comments

When you enable typescript, the linter complains that afterPageLoad function cannot return void. So you have to add a return true (or false?) in the function.

Argument of type '(page: ClientNodeApi) => void' is not assignable to parameter of type '(page?: ClientNodeApi) => boolean'.
  Type 'void' is not assignable to type 'boolean'.ts(2345)

See helper documentation

Other typescript issue ( getDirection (path1, path2)):

$: lastRoute = $route.last

$route is of type never, so typescript won't eat this.

Tommertom avatar Jun 07 '22 17:06 Tommertom