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,
null,
null,
3.4258070918918153,
1.9795270028465035
]

Specification

JSON schema

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