Can you just use bool instead of Var<bool> in TaskItem?

By on 11/17/2015 3:05 PM ()

Hum, probably but in your samples on UI.Next you use Var<bool> that's why.

And for the Key, I also would generate it myself too but what would be the benefit of using Key from UI.Next ?

By on 11/17/2015 3:10 PM ()

Guess it would be the same if you use your own unique key. If you don't have one then Key is useful since you can call Key.Fresh() to generate a new unique key.

Key seems to be just a simple counter:

1
2
3
4
5
6
7
8
9
10
11
12
13
[<JavaScript>]

type Key =
    | Key of int
    static member Fresh () = Key (Fresh.Int ())

[<JavaScript>]
module Fresh =
    let mutable private counter = 0

    let Int () =
        counter <- counter + 1
        counter
By on 11/17/2015 4:02 PM ()

Double post (bug of my browser sorry)

By on 11/17/2015 10:14 PM ()

Yes sure, I will use my own unique key so.

I guess the Var<>should be used only to handle the change in the view but the model should use "pure" types. Like bool, int, string, etc. I will try this way so.

Thanks for your support.

By on 11/17/2015 10:14 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper