Skip to content

Instantly share code, notes, and snippets.

@jobjo
Created July 12, 2011 16:05
Show Gist options
  • Save jobjo/1078291 to your computer and use it in GitHub Desktop.
Save jobjo/1078291 to your computer and use it in GitHub Desktop.
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