Skip to content

Commit b29a636

Browse files
docs(website): tiny fixes
1 parent 0370e12 commit b29a636

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export default () => [
2+
{
3+
fileName: 'overmind/actions.ts',
4+
code: `
5+
import { Action } from './'
6+
7+
const doThis: Action = () => {}
8+
`,
9+
},
10+
{
11+
fileName: 'overmind/someNamespace/actions.ts',
12+
code: `
13+
import { Action } from '../'
14+
15+
const doThis: Action = () => {}
16+
`,
17+
},
18+
]

packages/overmind-website/guides/beginner/01_getstarted.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ If you are moving from an existing state management solution, please read the re
44

55
To get started with Overmind you have to set up a project. You can do this with whatever tool your framework of choice provides or you can use [webpack](https://webpack.js.org/) or [parceljs](https://parceljs.org/). You can also use [codesandbox.io](https://codesandbox.io/) to play around with Overmind directly in the browser.
66

7+
```marksy
8+
h(TypescriptNotice, null, "Overmind requires Typescript version **3.2** or above")
9+
```
10+
711
When you have your project up and running install the Overmind dependency by using [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/en/):
812

913
```marksy

packages/overmind-website/guides/intermediate/03_typescript.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ You can also explicitly type your application. This gives more flexibility.
2323
h(Example, { name: "guide/typescript/explicit.ts" })
2424
```
2525

26+
You only have to set up these types once, where you instantiate Overmind. That means if you use multiple namespaced configuration you still only create one set of types, as shown above.
27+
28+
Now you only have to make sure that you import your types from this file, instead of directly from the Overmind package.
29+
30+
```marksy
31+
h(Example, { name: "guide/typescript/explicit_import.ts" })
32+
```
33+
34+
```marksy
35+
h(Notice, null, "The Overmind documentation is written for implicit typing. That means whenever you see a type import directly from the Overmind package, you should rather import from your own defined types")
36+
```
37+
38+
2639
## Actions
2740

2841
The action type takes either no arguments or a single argument. If you give no arguments to the action it will be typed as not expecting an argument at all. When you do type with an argument that is the type of the **value** on the context. This value is populated when you call the action on the Overmind instance.

0 commit comments

Comments
 (0)