Skip to content

Commit

Permalink
Expose JS API (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentlb authored Apr 22, 2024
1 parent e12e162 commit b1deefb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions SMBolero.Client/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ open Bolero
open Bolero.Html
open Bolero.Remoting.Client
open Bolero.Templating.Client
open Microsoft.JSInterop

/// Routing endpoints definition.
type Page =
Expand Down Expand Up @@ -60,6 +61,12 @@ let minify flags content =

out.ToString(), ShaderMinifier.getSize shaders, withLoc.ToString()

module API =
[<JSInvokableAttribute("minify")>]
let minify flags content =
let result, _, _ = minify flags content
result

let update (jsRuntime: Microsoft.JSInterop.IJSRuntime) message model =
match message with
| SetPage page ->
Expand Down

0 comments on commit b1deefb

Please sign in to comment.