Logo GenPRES

MessageFormatter Module

Creates a function formatting a message as text with the formatter registered for the message type, or with a fallback when none is registered.

Functions and values

Function or value Description

MessageFormatter.create formatters msg

Full Usage: MessageFormatter.create formatters msg

Parameters:
Returns: string

Create a formatter that handles multiple message types

formatters : (Type * (IMessage -> string)) list
msg : IMessage
Returns: string

MessageFormatter.createWithFallback formatters fallback msg

Full Usage: MessageFormatter.createWithFallback formatters fallback msg

Parameters:
Returns: string

Create a formatter with fallback

formatters : (Type * (IMessage -> string)) list
fallback : IMessage -> string
msg : IMessage
Returns: string

Type something to start searching.