Skip to content

Commit

Permalink
Improve docs readability (#1592)
Browse files Browse the repository at this point in the history
* Improve docs readability

* Update lazy-mode.md
  • Loading branch information
ovidiuch committed Jan 10, 2024
1 parent c00ca07 commit d60c866
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/pages/docs/configuration/lazy-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

In lazy mode, Cosmos dynamically imports fixture and decorator modules only when they are needed, specifically when a fixture is selected in the Cosmos UI. This approach results in code splitting and enhances the isolation of the selected fixture. In this mode, fixture names of [Multi-Fixtures](/docs/fixtures/fixture-modules.md#multi-fixtures) are only revealed upon selection.

To enable lazy mode:
## Enabling Lazy Mode

Lazy mode is disabled by default. There are two ways to enable lazy mode:

- Set the `lazy` option to `true` in the Cosmos config.
- Use the `--lazy` CLI argument when running a Cosmos command.

Lazy mode is disabled by default.
4 changes: 2 additions & 2 deletions docs/pages/docs/fixtures/ui-controls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ The `useValue` hook can be used to control any type of serializable data, like s
import { useSelect } from 'react-cosmos/client';

export default () => {
// useSelect also returns a setter as the second value in the return tuple,
// like the useState hook, in case you want to change the value programatically.
const [buttonType] = useSelect('buttonType', {
options: ['primary', 'secondary', 'danger'],
});
Expand All @@ -43,6 +41,8 @@ export default () => {
};
```

`useSelect` also returns a setter as the second value in the return tuple, like the `useState` hook, in case you want to change the value programatically.

<Callout type="info">
`useValue` and `useSelect` (and Cosmos in general) work great with TypeScript.
</Callout>
Expand Down

0 comments on commit d60c866

Please sign in to comment.