diff --git a/docs/Navs-Avalonia.md b/docs/Navs-Avalonia.md index c5fe8ba..5e14556 100644 --- a/docs/Navs-Avalonia.md +++ b/docs/Navs-Avalonia.md @@ -17,7 +17,7 @@ That being said... ## Usage [hide] - #r "nuget: Navs.Avalonia, 1.0.0-beta-008" + #r "nuget: Navs.Avalonia, 1.0.0-rc-002" #r "nuget: FSharp.Data.Adaptive, 1.2.14" Using this library is very similar to using the base Navs library. The main difference is that the `Navs.Avalonia` library provides a less generic versions of the API. @@ -246,11 +246,10 @@ Hoisting events is a common pattern and tends to be the most flexible way to han For cases where you might want to _bind_ the value to a control and make changes propagate automatically, you can use `changeable values` which are adaptive values that can be set directly. let myTextBox(value: cval) = + // requires open Navs.Avalonia TextBox() - .text( - value - |> CVal.toBinding - ) + .text(value |> AVal.toBinding) + .OnTextChangedHandler(fun sender _ -> sender.Text |> AVal.setValue value) let parent() = let sharedValue = cval "Hello" diff --git a/docs/Navs.fsx b/docs/Navs.fsx index f2efb1a..64bcbc8 100644 --- a/docs/Navs.fsx +++ b/docs/Navs.fsx @@ -24,7 +24,7 @@ From there on, you can use the router to navigate to different parts of your app *) (*** hide ***) -#r "nuget: Navs, 1.0.0-beta-008" +#r "nuget: Navs, 1.0.0-rc-002" open FSharp.Data.Adaptive open System @@ -354,6 +354,7 @@ If any of the above checks true, then you should consider caching the view - [ ] Is the view state ephemeral and can be discarded when navigating away? - [ ] Do you want to avoid stale data any time the route is activated? +- [ ] Do you need to dispose of resources when the route is deactivated? If any of the above checks true, then you should consider not caching the view. diff --git a/docs/Navs/Adapters.md b/docs/Navs/Adapters.md index 2663ad0..732223a 100644 --- a/docs/Navs/Adapters.md +++ b/docs/Navs/Adapters.md @@ -7,7 +7,7 @@ category: Navs ## Creating an adapter. [hide] - #r "nuget: Navs, 1.0.0-beta-008" + #r "nuget: Navs, 1.0.0-rc-002" Sometimes you may want to create a custom adapter when you know the concrete types (or the interface) that you're targeting with your router and your definitions. This is a guide on how to create an adapter for a custom type. @@ -17,9 +17,9 @@ Let's take a look at how we implemented the Plain Avalonia adapter. Normal Avalo open Navs.Router type AvaloniaRouter(routes, [] ?splash: Func) = - let router = Router.get(routes, ?splash = splash) + let router = Router.build(routes, ?splash = splash) let splash = splash |> Option.map(fun f -> fun () -> f.Invoke()) - Router.get(routes, ?splash = splash) + Router.build(routes, ?splash = splash) interface IRouter with @@ -71,7 +71,7 @@ Once that is done, we can convert our route definitions to the custom type and u From - let router = Router.get([ + let router = Router.build([ Route.define("Home", "/", fun ctx _ -> async { do! Async.Sleep 90 return UserControl() diff --git a/docs/Navs/DotnetUsage.md b/docs/Navs/DotnetUsage.md index 77caca1..4a8a25c 100644 --- a/docs/Navs/DotnetUsage.md +++ b/docs/Navs/DotnetUsage.md @@ -33,7 +33,7 @@ RouteDefinition[] routes = [ }) ]; -IRouter router = Router.Get(routes); +IRouter router = Router.Build(routes); ``` From there on, you can use the router as you would in F#. for more information visit the [Navs](../Navs.fsx) general documentation. diff --git a/docs/UrlTemplates.fsx b/docs/UrlTemplates.fsx index b16b04d..8f48144 100644 --- a/docs/UrlTemplates.fsx +++ b/docs/UrlTemplates.fsx @@ -12,7 +12,7 @@ This library specializes itself in parsing URL-like strings into structured obje *) (*** hide ***) -#r "nuget: UrlTemplates, 1.0.0-beta-008" +#r "nuget: UrlTemplates, 1.0.0-rc-002" open System (** diff --git a/docs/index.md b/docs/index.md index 68dc467..54fda53 100644 --- a/docs/index.md +++ b/docs/index.md @@ -39,7 +39,7 @@ let routes = [ ) ] -let router = Router.get(routes) +let router = Router.build(routes) router.Content.AddCallback(fun content -> printfn $"%A{content}")