FakeVar

This module contains helpers for managing build time variables

Functions and values

Function or valueDescription
FakeVar.define(name)
Signature: name:string -> (unit -> 'a option) * (unit -> unit) * ('a -> unit)
Type parameters: 'a

Define a named FakeVar providing the get, remove and set And of the functions will fail if there is no context

FakeVar.defineAllowNoContext(name)
Signature: name:string -> (unit -> 'a option) * (unit -> unit) * ('a -> unit)
Type parameters: 'a

Define a named FakeVar providing the get, remove and set Will use a local variable if there is no context

FakeVar.defineOrNone(name)
Signature: name:string -> (unit -> 'a option) * (unit -> unit) * ('a -> unit)
Type parameters: 'a

Define a named FakeVar providing the get, remove and set Will always return 'None' when no context is set and 'throw' on set

FakeVar.get(name)
Signature: name:string -> 'a option
Type parameters: 'a

Gets a strongly typed FakeVar by name returning an option type

FakeVar.getOrDefault name defaultValue
Signature: name:string -> defaultValue:'a -> 'a
Type parameters: 'a

Gets a strongly typed FakeVar by name will return default value if variable is not found

FakeVar.getOrFail(name)
Signature: name:string -> 'a
Type parameters: 'a

Gets a strongly typed FakeVar by name will fail if variable is not found

FakeVar.remove(name)
Signature: name:string -> unit

Removes a FakeVar by name

FakeVar.set name v
Signature: name:string -> v:'a -> unit
Type parameters: 'a

Sets value of a FakeVar