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?
Asked
Active
Viewed 85 times
2

Goswin Rothenthal
- 2,244
- 1
- 19
- 32
1 Answers
3
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.

Kimserey
- 73
- 1
- 5
-
thanks, would this be the same as the inline text `"$obj.$key = $value"` ? – Goswin Rothenthal Jun 09 '16 at 15:18
-
1It would be the same as `void ($obj[$key] = $value)` yes. – Kimserey Jun 09 '16 at 19:36