Header menu logo issie

JSHelpers Module

Functions and values

Function or value Description

alert msg

Full Usage: alert msg

Parameters:
    msg : 'a

msg : 'a

assertNotNull obj msg

Full Usage: assertNotNull obj msg

Parameters:
    obj : 'a
    msg : 'b

Returns: 'a

Assert js object is not null, and return it.

obj : 'a
msg : 'b
Returns: 'a

debugLevel

Full Usage: debugLevel

Returns: int
Returns: int

delayedDispatch dispatch delayInMs msg

Full Usage: delayedDispatch dispatch delayInMs msg

Parameters:
    dispatch : 'a -> unit
    delayInMs : int
    msg : 'a

Returns: int
dispatch : 'a -> unit
delayInMs : int
msg : 'a
Returns: int

emptyJsList ()

Full Usage: emptyJsList ()

Parameters:
    () : unit

Returns: 'a
() : unit
Returns: 'a

fshaprListToJsList list

Full Usage: fshaprListToJsList list

Parameters:
    list : 'a list

Returns: 'a0
list : 'a list
Returns: 'a0

getBigintEventValue event

Full Usage: getBigintEventValue event

Parameters:
Returns: BigInteger
event : Event
Returns: BigInteger

getFailIfNull jsObj fields

Full Usage: getFailIfNull jsObj fields

Parameters:
    jsObj : 'a
    fields : string list

Returns: 'b

Access nested fields of a js object, failing if at any point of the chain the requested field is null. Should be used when the fields are guaranteed to exist. For example ["a"; "b"; "c"] is equivalent to the jsCode `obj.a.b.c`, but with checks against null at every layer.

jsObj : 'a
fields : string list
Returns: 'b

getFloatEventValue event

Full Usage: getFloatEventValue event

Parameters:
Returns: float
event : Event
Returns: float

getInt64EventValue event

Full Usage: getInt64EventValue event

Parameters:
Returns: int64
event : Event
Returns: int64

getIntEventValue event

Full Usage: getIntEventValue event

Parameters:
Returns: int

Get the value for a change event in an input number box, making sure it is an F# integer (JS integer values may not be precise)

event : Event
Returns: int

getProcessPrivateMemory ()

Full Usage: getProcessPrivateMemory ()

Parameters:
    () : unit

Returns: int
() : unit
Returns: int

getTextEventValue event

Full Usage: getTextEventValue event

Parameters:
Returns: string

Get the value for a change event in an input textbox.

event : Event
Returns: string

getTextFocusEventValue event

Full Usage: getTextFocusEventValue event

Parameters:
Returns: string

Get the value for a blur event in an input textbox.

event : FocusEvent
Returns: string

globalGC

Full Usage: globalGC

Returns: unit -> unit
Returns: unit -> unit

heapLimit ()

Full Usage: heapLimit ()

Parameters:
    () : unit

Returns: int

V8 heap size limit in bytes (set by --max-old-space-size in Main.fs). NB totalJSHeapSize (maxHeap) is the currently *allocated* heap, not the limit.

() : unit
Returns: int

isNull obj

Full Usage: isNull obj

Parameters:
    obj : obj

Returns: bool
obj : obj
Returns: bool

jsListToFSharpList jsList

Full Usage: jsListToFSharpList jsList

Parameters:
    jsList : 'a

Returns: 'b list

Transforms a js list of jsType into an f# list of jsType. If jsList is not a js list, fail.

jsList : 'a
Returns: 'b list

jsType var

Full Usage: jsType var

Parameters:
    var : obj

var : obj

loggingMemory

Full Usage: loggingMemory

Returns: bool
Returns: bool

maxHeap ()

Full Usage: maxHeap ()

Parameters:
    () : unit

Returns: int
() : unit
Returns: int

memSize

Full Usage: memSize

Returns: int
Returns: int

periodicDispatch dispatch delayInMs msg

Full Usage: periodicDispatch dispatch delayInMs msg

Parameters:
    dispatch : 'a -> unit
    delayInMs : int
    msg : 'a

Returns: int
dispatch : 'a -> unit
delayInMs : int
msg : 'a
Returns: int

productionBuild

Full Usage: productionBuild

Returns: bool
Returns: bool

setDebugLevel ()

Full Usage: setDebugLevel ()

Parameters:
    () : unit

Hack to provide a constant global variable set from command line arguments of main process. 0 => production. 1 => dev. 2 => debug. Also reads --log=wire,sim, which is the only way to have a log category on before the first line of startup runs - the Development menu and window.issieLog can only be reached later, by which time loading a project is already over.

() : unit

startTimer label

Full Usage: startTimer label

Parameters:
    label : string

label : string

stopAndLogTimer label

Full Usage: stopAndLogTimer label

Parameters:
    label : string

label : string

usedHeap ()

Full Usage: usedHeap ()

Parameters:
    () : unit

Returns: int
() : unit
Returns: int

uuid ()

Full Usage: uuid ()

Parameters:
    () : unit

Returns: string

return a v4 (random) universally unique identifier (UUID) Under plain .NET the npm uuid package is not there, and a Fable import compiles to code that throws when called. Minting an id is not draw-block-specific - every path that adds a component or a port needs one - so the tests could not reach any of them. .NET has its own v4 generator, and nothing depends on which one produced an id, only that it is unique.

() : unit
Returns: string

Type something to start searching.