Releases: fsbolero/Bolero
Bolero 0.2
Features
#10: Router: add full path specification. Documentation
Routers can now use EndPointAttribute
to specify the full shape of the path for a given union case, rather than just a single prefix fragment. These paths can freely mix constant and parameter fragments, and several cases can share a common prefix of one or multiple fragments.
type Page =
| [<EndPoint "/article/{id}">]
Article of id: int
| [<EndPoint "/list/{page}/{*tags}">]
ArticleList of page: int * tags: list<string>
| [<EndPoint "/user/{username}/favorites">]
UserFavorites of username: string
| [<EndPoint "/user/{username}/comments">]
UserComments of username: string
Specifying a single prefix fragment is still supported in a fully compatible way.
Bolero 0.1.89
Features
#13: Add DOM element reference functions.
-
attr.ref : (ElementRef -> unit) -> Attr
calls the given function with a reference to the element when it is inserted. -
attr.bindRef : ElementRefBinder -> Attr
binds the element when it is inserted. TheElementRefBinder
is typically created as a component field usingElementRefBinder()
and used in event handlers through its.ref
property, of typeElementRef
.
type View() =
inherit ElmishComponent<Model, Message>()
let buttonRef = ElementRefBinder()
override this.View model dispatch =
button [
attr.bindRef buttonRef
on.click (fun _ -> someJsCallback(buttonRef.ref))
] [text "Click me!"]