Skip to content

Instantly share code, notes, and snippets.

View object's full-sized avatar

Vagif Abilov object

View GitHub Profile
@object
object / Model.fs
Created June 27, 2024 18:03
Fable workshop (2024). Step 6. Model.fs
module Model
[<RequireQualifiedAccess>]
type EventSet =
| Small
| Large
type Model =
{ EventSet: EventSet
PlaybackDelay : int
@object
object / View.fs
Last active June 27, 2024 17:50
Fable workshop (2024). Step 5. View.fs
module View
open Feliz
open System
open Model
open Messages
let view (state : Model) dispatch =
@object
object / App.fs
Created June 27, 2024 17:34
Fable workshop (2024). Step 4. App.fs
module App
open Elmish
open Elmish.React
open Update
open View
Program.mkProgram init update view
|> Program.withReactSynchronous "elmish-app"
@object
object / App.fs
Last active June 27, 2024 15:56
Fable workshop (2024). Step 4. App.fs
module App
open Elmish
open Elmish.React
#if DEBUG
open Elmish.Debug
open Elmish.HMR
#endif
@object
object / Index.fs
Created June 27, 2024 12:17
Fable workshop (2024). Step 3. Index.fs
module Index
open Elmish
open Fable.SimpleHttp
type Model = {
Filename: string
Events : string
Error : string }
@object
object / App.fs
Last active June 27, 2024 12:11
Fable workshop (2024). Step 3. App.fs
module App
open Elmish
open Elmish.React
Program.mkProgram Index.init Index.update Index.view
|> Program.withReactSynchronous "elmish-app"
|> Program.run
@object
object / View.fs
Last active June 27, 2024 15:53
Fable workshop (2024). Step 4. View.fs
module View
open System
open Model
open Messages
open Fable.React
open Fable.React.Props
let view (state : Model) dispatch =
@object
object / Update.fs
Last active October 18, 2024 09:12
Fable workshop (2024). Step 4. Update.fs
module Update
open System
open Elmish
open Fable.SimpleHttp
open Model
open Messages
let tryParseWith (tryParseFunc: string -> bool * _) = tryParseFunc >> function
@object
object / Model.fs
Last active June 27, 2024 15:54
Fable workshop (2024). Step 4. Model.fs
module Model
type Model =
{ Filename: string
PlaybackDelay : int
IsPlaying : bool
Events : string array
EventIndex : int
Error : string }
static member Empty =
@object
object / Messages.fs
Last active June 27, 2024 15:54
Fable workshop (2024). Step 4. Messages.fs
module Messages
type Msg =
| FilenameChanged of string
| PlaybackDelayChanged of string
| StartPlayback
| PausePlayback
| StopPlayback
| NextEvent
| EventsLoaded of string