简体   繁体   中英

WebSharper Operators

Being new to WebSharper I am looking for documentation and examples on Operators such as ? , ?<- , -< , ===. , => or |>! . I did not find it in http://websharper.com/docs . Did I miss it? (there are some listed in http://websharper.com/docs/wig#heading-2-2 but i believe those are only for creating interfaces for existing JS libraries.) Some are listed here (3 years ago), do those still apply to UI.Next html?

The operators you mentioned were added by WebSharper for convenience.

For example ?<- is used to mutate a property of an object.

Here's its implementation:

[<Inline "void ($obj[$key] = $value)">]
let ( ?<- ) (obj: obj) (key: string) (value: obj) = X<unit>

All the operators can be found in WebSharper code base under JavaScript.Pervasives.fs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM