Skip to main content

Selection functions

previousEvent

Commentary

added in 0.0.5

stateful function

Obtains the last event generated. Can optionally drill into a subvalue using path.


Examples

Getting the last event

{
"_gen": "oneOf",
"choices": [
{
"_gen": "previousEvent",
"path": [
"value"
]
},
{
"_gen": "uniformDistribution",
"bounds": [
1,
4
]
}
]
}
[
null,
1.5389686863536411,
1.5389686863536411,
1.5389686863536411,
1.5389686863536411
]

Specification

JSON schema

{
"type": "object",
"properties": {
"path": {
"type": "array",
"items": {
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "string"
}
]
}
}
}
}