1
0
Fork 0
freesewing/sites/dev/docs/reference/store-methods/flag.preset
Joost De Cock ab3204f9f1 chore: Port FreeSewing.dev to docusaurus
The replaces the NextJS site powering FreeSewing.dev with a Docusaurus
setup. It's part of my efforts to simplify FreeSewing's setup so we can
focus on our core value proposition.
2024-09-28 13:13:48 +02:00
..
readme.mdx chore: Port FreeSewing.dev to docusaurus 2024-09-28 13:13:48 +02:00

---
title: flag.preset()
---

The `flag.preset()` method is a way to flag a pre-defined flag object.
There are currently two such pre-defined flags provided by the annotations-plugin:

- `expandIsOn`
- `expandIsOff`

They inform the user about the effect of the `expand` setting on the pattern, when `expand`
is on or off respectively.

## Signature

```js
undefined Store.flag.preset(string preset)
```

Since these methods are not part of FreeSewing's core API, what you pass to this method does depend on your own implementation.
The example above is from our implementation, which uses the following properties:

## Configuration

| Property   | Type                | Description |
| ----------:| ------------------- | ----------- |
| `preset`   | String              | The ID of an existing preset |

## Example

```js
({ store, expand,  part }) => {
  store.flag.preset(expand
    ? 'expandIsOn'
    : 'expandIsOff'
  )

  return part
}
```