Created
July 12, 2011 16:05
-
-
Save jobjo/1078291 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type UserInfo = { Name: string; Email : string} | |
module Server = | |
[<Rpc>] | |
let GetUsers () = | |
Db.GetUsers // Your db call | |
|> Seq.map (fun u -> | |
{ | |
Name = u.Name | |
Email = u.Email | |
} | |
) | |
|> Seq.toList | |
module Client = | |
[<JavaScript>] | |
let UserFormlet (users: list<UserInfo>) = | |
Controls.Select ... | |
type ClientControl(users: list<UserInfo>) | |
inherit IntelliFactory.WebSharper.Web.Control() | |
new () = new ClientControl([]) | |
[<JavaScript>] | |
override this.Body = | |
UserFormlet users | |
:> _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment