2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: postSample
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
The `postSample` hook runs just after your pattern is sampled.
|
2022-09-29 23:43:00 +02:00
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
|
|
|
```js
|
|
|
|
null hook(Pattern pattern)
|
|
|
|
```
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```js
|
|
|
|
pattern.on('postSample', pattern => {
|
|
|
|
// Mutate the pattern object here
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
The `postSample` hook is rarely used, but it's there if you need it.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
It is triggered just before the end of either:
|
|
|
|
|
2022-08-20 18:33:05 -04:00
|
|
|
- the [Pattern.sampleOption()](/reference/api/pattern/sampleoption) method
|
|
|
|
- the [Pattern.sampleMeasurement()](/reference/api/pattern/samplemeasurement) method
|
|
|
|
- the [Pattern.sampleModels()](/reference/api/pattern/samplemodels) method
|
2021-08-25 16:09:31 +02:00
|
|
|
|