This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ded63d
commit 4188966
Showing
5 changed files
with
97 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,2 @@ | ||
namespace FSharp.Desktop.UI | ||
|
||
[<AbstractClass>] | ||
type Controller<'Event, 'Model>() = | ||
|
||
interface IController<'Event, 'Model> with | ||
member this.InitModel model = this.InitModel model | ||
member this.Dispatcher = this.Dispatcher | ||
|
||
abstract InitModel : 'Model -> unit | ||
abstract Dispatcher : ('Event -> EventHandler<'Model>) | ||
|
||
static member Create callback = { | ||
new IController<'Event, 'Model> with | ||
member this.InitModel _ = () | ||
member this.Dispatcher = callback | ||
} | ||
|
||
static member Create callback = { | ||
new IController<'Event, 'Model> with | ||
member this.InitModel _ = () | ||
member this.Dispatcher = fun event -> Sync(callback event) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters