Questions tagged [elmish]

Use for question relating to the elmish framework for f#. Consider also including the tags [fable-f#] and [f#].

Elmish is an implementation of the in and . It is modular in its design and can target different platforms and rendering libraries, but is typically used with , using elmish-react, and targeting web browsers, using elmish-browser.

Resources

65 questions
1
vote
1 answer

Avoiding code duplication in F# when making a form based app for multiple data types

I am currently making an app in F# with fable elmish architecture where the record types are as follows (cut down to save space but you hopefully get the idea). type NewOriginMerdEntry = | AddOriginMerdID of string | AddMerdNumber of int …
Simplexity
  • 77
  • 1
  • 3
1
vote
3 answers

Call component method when model property changes

In my Fable app with Elmish I have a view that uses react-slick and a button that should be able to change the slide number on click: Fable.Import.Slick.slider [ InitialSlide model.SlideNumber AfterChange (SlideTo >> dispatch) ] …
Johannes Egger
  • 3,874
  • 27
  • 36
1
vote
1 answer

Equivalent of data binding model updates in Elm-style model-view-update

MVU State Changes As I understand Elm-style model-view-update architectures, changes to application state follow the sending of a message that defines the updated state. The state here is immutable, so changes result in a whole new set of…
Sean Kearon
  • 10,987
  • 13
  • 77
  • 93
1
vote
1 answer

How to encapsulate logic within children like component frameworks?

I'm trying to understand how to create reusable components using the Elmish architecture within F# Bolero by WebSharper (e.g. a reusable validated form input). From all of the examples I've seen, the top level Parent must handle all messages/updates…
Weebs
  • 435
  • 6
  • 17
1
vote
1 answer

dispatch method in view for parent child composition

I am trying to understand the way fable is supposed to work with parent child composition. Things are quite easy when it comes to update method, init, and the definition of commands. But the view method and its dispatch method are tricky to find…
Yoann
  • 546
  • 4
  • 11
0
votes
0 answers

How to send a message to the Dispatcher from a custom event in Elmish.wpf/Elmish?

In F#, I have a custom event as a singleton: type EventMediator private () = let mutable _name = ""; static member val private _instance = lazy EventMediator() static member Instance = EventMediator._instance.Value member val…
Alan Wayne
  • 5,122
  • 10
  • 52
  • 95
0
votes
0 answers

Parent Element triggering unintended Msg Dispatch simultaneously / autonomously in F#-Fable/Elmish OnClick

As per the following example, I'm trying to ideally have the clicking of the Edit Icon Button ONLY Dispatch the InitiateEdit Msg associated with the OnClick there, whilst I have a different InitiateSelect Msg Dispatched from OnClick for the entire…
SteelCityRKP
  • 139
  • 10
0
votes
1 answer

How will an Emlish app respond to high frequency updates?

If an Elmish app were to receive updates faster than it can render the view, will it queue each update and resulting model change and try to render them one by one, or will it accumulate the resulting model and only render it whenever it gets a gap?
Chechy Levas
  • 2,206
  • 1
  • 13
  • 28
0
votes
1 answer

Fable Elmish url change events management without hashbang

Give the following very basic Fable.Lit elmish application module App open Elmish open Elmish.Navigation open Lit type Route = | Contract | Product | Chart type Model = { Route_ : Route option } type Msg = ... let init route_ =…
Franco Tiveron
  • 2,364
  • 18
  • 34
0
votes
1 answer

Project Doesn't Load With Elmish-React

I have a simple elmish react project directly from the template and when I run it it loads the public index.html page but nothing else and stucks eternely loading (I presume) the bundle.js from the webpack I picked the Fable template added the…
fourglobe
  • 31
  • 6
0
votes
1 answer

How do I write encoders/decoders for Thoth.Json in the SAFE Stack?

I'm building an application using the SAFE Stack and I have a System.Uri in my model. When I run my code I get an error in the console "Cannot generate autoencoder for System.Uri..." My googling has got me to here so far module CustomEncoders open…
David Hayes
  • 7,402
  • 14
  • 50
  • 62
0
votes
1 answer

Fable.Reactstrap not defined on Client fsproj SATE-stack

I'm trying to use Fable.Reactstrap on Client project from SAFE.Template. I've added Fable.Reactstrap to Nuget, Paket, and NPM but still receive error FSHARP: The namespace 'Reactstrap' is not defined when executing dotnet run. It's an error from…
Riza
  • 1,144
  • 8
  • 19
0
votes
1 answer

How can I add a HTML control dynamically to the result view in Fable F#?

I am trying to understand the very first project that is generated when you create a elmish/fable project like so: dotnet new fable-react-elmish: let view (model: Model) dispatch = let resultView = match model.downloaded with | Ok r…
Angle.Bracket
  • 1,438
  • 13
  • 29
0
votes
1 answer

How to get the latitude and longtitude in the center of view.map (Xamarin.Forms.Maps) when region changed?

Please comment, how to get the latitude and longitude in the center of map (Xamarin.Forms.Maps) when region changed? In C#, retrieve the property…
madeinQuant
  • 1,721
  • 1
  • 18
  • 29
0
votes
0 answers

How do I get a datagrid type control in fsprojects/Fabulous

fsproject/Fabulous does not appear to have a datagrid. That would be a columnated ListView with non-scrolling header and footer rows (not grouping headers). Such a control seems essential for any line of business (LOB) application. It is also…
George
  • 2,451
  • 27
  • 37