-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
26 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,8 +277,9 @@ module ClientSideInternals = | |
|
||
open ClientSideInternals | ||
|
||
/// Implements a web control based on a quotation-wrapped top-level body. | ||
/// Use the function ClientSide or ctx.ClientSide to create an InlineControl. | ||
/// Embed the given client-side control body in a server-side control. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
/// The client-side control body must be an implicit or explicit quotation expression. | ||
/// It can capture local variables, of the same types which are serializable by WebSharper as RPC results. | ||
[<CompiledName "FSharpInlineControl">] | ||
type InlineControl<'T when 'T :> IControlBody>(elt: Expr<'T>) = | ||
inherit Control() | ||
|
@@ -330,6 +331,11 @@ type InlineControl<'T when 'T :> IControlBody>(elt: Expr<'T>) = | |
member this.Encode(meta, json) = | ||
[this.ID, json.GetEncoder(this.GetType()).Encode this] | ||
|
||
/// Embed the given client-side control body in a server-side control. | ||
/// The client-side control body must be an implicit or explicit quotation expression. | ||
/// It can capture local variables, of the same types which are serializable by WebSharper as RPC results. | ||
static member Create<'T when 'T :> IControlBody> ([<JavaScript; ReflectedDefinition>] e: Expr<'T>) = | ||
This comment has been minimized.
Sorry, something went wrong.
granicz
Member
|
||
new InlineControl<'T>(e) | ||
|
||
open System | ||
open System.Reflection | ||
|
@@ -435,8 +441,6 @@ module WebExtensions = | |
open Microsoft.FSharp.Quotations | ||
open WebSharper.Web | ||
|
||
/// Embed the given client-side control body in a server-side control. | ||
/// The client-side control body must be an implicit or explicit quotation expression. | ||
/// It can capture local variables, of the same types which are serializable by WebSharper as RPC results. | ||
[<System.Obsolete "Use `WebSharper.Web.InlineControl.Create` instead">] | ||
This comment has been minimized.
Sorry, something went wrong. |
||
let ClientSide ([<JavaScript; ReflectedDefinition>] e: Expr<#IControlBody>) = | ||
new InlineControl<_>(e) |
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
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
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
We should use third person mode in comments, "Embeds ...", etc.