dotnet-websharper / ui

A reactive UI library for WebSharper.
https://websharper-samples.github.io/ui/
Apache License 2.0
77 stars 22 forks source link

Add OnAfterRender variant to templating with access to template model #226

Closed granicz closed 2 years ago

granicz commented 3 years ago

We should be able to access a template's state in an OnAfterRender (OAR) handler, both in server-side and client-side templates.

Ideally, this can take two forms:

(Edited)

  1. Via a new member on the template instance coming from the type provider, or
  2. Via a manually added ws-onafterrender="your hander" attribute. This would be normally placed on the container node that defines the template itself,

This ticket is for the F# side, closed when that's done. The work for C# is tracked on a separate ticket - https://github.com/dotnet-websharper/ui/issues/230.

granicz commented 3 years ago

We opted for option 2) above, so the OAR handler has to be declared in the template via ws-onafterrender="xxx".

granicz commented 2 years ago

Seems item 2) is included already, so closing this ticket.