Skip to content

Releases: fsbolero/Bolero

Bolero 0.2

22 Jan 20:46
20b7622
Compare
Choose a tag to compare
Bolero 0.2 Pre-release
Pre-release

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

22 Jan 20:54
Compare
Choose a tag to compare
Bolero 0.1.89 Pre-release
Pre-release

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. The ElementRefBinder is typically created as a component field using ElementRefBinder() and used in event handlers through its .ref property, of type ElementRef.

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!"]