2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: postDraft
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-29 23:43:00 +02:00
|
|
|
The `postDraft` lifecycle hook runs just after your pattern is drafted.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-29 23:43:00 +02:00
|
|
|
## Signature
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-29 23:43:00 +02:00
|
|
|
```js
|
|
|
|
null hook(Pattern pattern)
|
|
|
|
```
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-29 23:43:00 +02:00
|
|
|
## Example
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-29 23:43:00 +02:00
|
|
|
```js
|
|
|
|
pattern.on('postDraft', pattern => {
|
|
|
|
// Mutate the pattern object here
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
The `postDraft` hook is rarely used, but it's there if you need it.
|