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
]
}
]
}
[
3.6460775967009655,
3.129526184336765,
3.129526184336765,
2.5454624174859495,
2.5454624174859495
]

Specification

JSON schema

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