Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelMunoz committed Nov 14, 2024
1 parent 23258aa commit 266d3cd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
9 changes: 4 additions & 5 deletions docs/Navs-Avalonia.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<string>) =
// 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"
Expand Down
3 changes: 2 additions & 1 deletion docs/Navs.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions docs/Navs/Adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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, [<Optional>] ?splash: Func<Control>) =
let router = Router.get<Control>(routes, ?splash = splash)
let router = Router.build<Control>(routes, ?splash = splash)
let splash = splash |> Option.map(fun f -> fun () -> f.Invoke())
Router.get<Control>(routes, ?splash = splash)
Router.build<Control>(routes, ?splash = splash)


interface IRouter<Control> with
Expand Down Expand Up @@ -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<Control>([
let router = Router.build<Control>([
Route.define<Control>("Home", "/", fun ctx _ -> async {
do! Async.Sleep 90
return UserControl()
Expand Down
2 changes: 1 addition & 1 deletion docs/Navs/DotnetUsage.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RouteDefinition<string>[] routes = [
})
];

IRouter<string> router = Router.Get<string>(routes);
IRouter<string> router = Router.Build<string>(routes);
```

From there on, you can use the router as you would in F#. for more information visit the [Navs](../Navs.fsx) general documentation.
2 changes: 1 addition & 1 deletion docs/UrlTemplates.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
(**
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let routes = [
)
]
let router = Router.get<string>(routes)
let router = Router.build<string>(routes)
router.Content.AddCallback(fun content -> printfn $"%A{content}")
Expand Down

0 comments on commit 266d3cd

Please sign in to comment.