Gjallarhorn


Gjallarhorn

Gjallarhorn is a library designed to manage notifications and mutable state. It provides mechanisms for signaling of changes, represented via signals.

Example

This example demonstrates using basic functionality in Gjallarhorn.

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
#r "Gjallarhorn.dll"
open Gjallarhorn

// Create a mutable variable
let var1 = Mutable.create 0
let var2 = Mutable.create 2
let result = Signal.map2 (fun a b -> a + b) var1 var2

Signal.Subscription.create (fun value -> printfn "The sum of our variables is %d" value) result

// Set first variable, which causes subscription to print
var1.Value <- 20
// Set first variable, which again causes subscription to print
var2.Value <- 22

Core Types and Usage

API Reference

  • API Reference contains automatically generated documentation for all types, modules and functions in the library. This includes additional brief samples on using most of the functions.

Gjallarhorn.Bindable

  • Gjallarhorn.Bindable builds on top of this project to provide a unidirectional architecture for XAML platforms, including WPF and Xamarin Forms.

Contributing and copyright

The project is hosted on GitHub where you can report issues, fork the project and submit pull requests.

The library is available under the MIT License, which allows modification and redistribution for both commercial and non-commercial purposes. For more information see the License file in the GitHub repository.

val var1 : obj

Full name: Index.var1
val var2 : obj

Full name: Index.var2
val result : obj

Full name: Index.result
val printfn : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
Fork me on GitHub