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 MyType = | |
| MyCase | |
static member statFun x = match x with MyCase -> "I'm static member function!" | |
static member statFunUnit () = "I'm static member function with unit param!" | |
static member statFunGeneric (x, y) = | |
match x with MyCase -> $"I'm static member function with generic param with value = %O{y}!" | |
static member statProp = "I'm static member property!" | |
member this.objProp = match this with MyCase -> "I'm object member property!" | |
member this.objFunGen x = match this with MyCase -> $"I'm object member function with param with value = %O{x}!" | |
member this.objFunUnit () = match this with MyCase -> "I'm object member function with unit param!" |
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
// Attribute can only use local functions so for the outsides ones, the binding is needed | |
let eq x y = Fable.React.Helpers.equalsButFunctions x y | |
[<ReactMemoComponent(memoAreEqual=nameof eq)>] | |
let MyFunc (txt: string) (number: int) = Html.div [ Html.h1 number; Html.p txt ] |
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
{ | |
"includeLanguages": { | |
"ftl": "html", | |
"jinja": "html", | |
"jinja2": "html", | |
"smarty": "html", | |
"tmpl": "gohtml", | |
"cshtml": "html", | |
"vbhtml": "html", | |
"razor": "html", |
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
[<Erase>] | |
type IProp<'comp when 'comp : not struct> = | Prop of string * obj | |
with | |
static member inline Create (value: string * obj) = Prop value | |
static member inline Build(props: IProp<'comp> seq) = props |> unbox<(string * obj) seq> |> createObj |> unbox<'comp> | |
let inline (!<) x = IProp.Build x | |
module Interop = | |
let inline mkProperty<'Component when 'Component : not struct> (key:string) (value:obj) : IProp<'Component> = |
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
module Operators | |
open Feliz | |
let inline (+@) (tag: IReactProperty list -> ReactElement) (className: string) (props: IReactProperty list) = | |
tag (props @ [ prop.className className ]) | |
let inline (++) (tag: IReactProperty list -> ReactElement) (prop: IReactProperty) (props: IReactProperty list) = | |
tag [prop; yield! props ] |
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
[<Interface>] | |
type HTMLAttributes<'element when 'element :> Element and 'element :> EventTarget> = | |
inherit AriaAttributes | |
inherit DOMAttributes<'element> | |
abstract member defaultChecked: bool option with get, set | |
[<Interface>] | |
type HTMLAttributesFactory<'Property, 'element when | |
'Property :> HTMLAttributes<'element> and |