Skip to content

Commit 367c28c

Browse files
docs(website): update docs to fit latest version
1 parent ae2acf9 commit 367c28c

File tree

6 files changed

+44
-32
lines changed

6 files changed

+44
-32
lines changed

packages/overmind-website/api/app.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,13 @@ The **App** class is used to create the application instance. The instance itsel
44

55
```marksy
66
h(Example, { name: "api/app_initialize" })
7+
```
8+
9+
You can pass a second argument to the **App** constructor. This is an options object with the following properties:
10+
11+
## devtools
12+
By default the application connects to the devtools on **localhost:3031**, but you can change this in case you need to use an IP address ot the devtools has configured with a different port.
13+
14+
```marksy
15+
h(Example, { name: "api/app_options_devtools" })
716
```
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Modules
22

3+
When you have multiple application configurations, each with their own state, effects etc. you can give them a namespace by simply importing the **modules** factory. This allows you to extends a configuration with an additional property, called *modules*. The return configuration will have the modules composed into the state, effects, actions and reactions with the selected namespaces.
4+
5+
36
```marksy
47
h(Example, { name: "api/modules" })
5-
```
6-
7-
When you have multiple application configurations, each with their own state, effects etc. you can give them a namespace by simply importing the modules and attach them to the **modules** config property.
8+
```

packages/overmind-website/examples/api/app_initialize.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ const app = new App({
3434
state,
3535
effects,
3636
actions
37-
}, {
38-
devtools: 'localhost:1234'
3937
})
4038
4139
export default app

packages/overmind-website/examples/guide/getstarted/devtoolsConnect.ts renamed to packages/overmind-website/examples/api/app_options_devtools.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
1-
export default (ts) =>
1+
import { tsAppIndex } from '../templates'
2+
3+
export default (ts, view) =>
24
ts
35
? [
46
{
57
fileName: 'app/index.ts',
68
code: `
79
...
10+
811
const app = new App(config, {
9-
devtools: 'localhost:1234'
12+
devtools: 'localhost:3031'
1013
})
11-
...
12-
`,
14+
15+
export default app
16+
`,
1317
},
1418
]
1519
: [
1620
{
1721
fileName: 'app/index.js',
1822
code: `
1923
...
20-
const app = new App({
21-
state,
22-
actions,
23-
effects
24-
}, {
25-
devtools: 'localhost:1234'
24+
25+
const app = new App(config, {
26+
devtools: 'localhost:3031'
2627
})
27-
...
28-
`,
28+
29+
export default app
30+
`,
2931
},
3032
]

packages/overmind-website/examples/api/modules.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,28 @@ export default (ts, view) =>
44
{
55
fileName: 'app.ts',
66
code: `
7-
import App, { TConnect } from 'overmind-${view}'
7+
import App, { modules } from 'overmind'
8+
import createConnect, { TConnect } from 'overmind-${view}'
89
import * as moduleA from './moduleA'
910
import * as moduleB from './moduleB'
1011
11-
const config = {
12+
const config = modules({
13+
state: {
14+
title: 'My app'
15+
},
1216
modules: {
1317
moduleA,
1418
moduleB
1519
}
16-
}
20+
})
1721
1822
declare module 'overmind' {
1923
interface IState extends TState<typeof config> {}
2024
interface IEffects extends TEffects<typeof config> {}
2125
}
2226
2327
24-
const app = new App(config, {
25-
devtools: 'localhost:1234'
26-
})
28+
const app = new App(config)
2729
2830
export type Connect = TConnect<typeof app>
2931
@@ -35,19 +37,23 @@ export default app
3537
{
3638
fileName: 'app/index.js',
3739
code: `
38-
import App from 'overmind-${view}'
40+
import App, { modules } from 'overmind'
41+
import createConnect from 'overmind-${view}'
3942
import * as moduleA from './moduleA'
4043
import * as moduleB from './moduleB'
4144
42-
const app = new App({
45+
const config = modules({
46+
state: {
47+
title: 'My app'
48+
},
4349
modules: {
4450
moduleA,
4551
moduleB
4652
}
47-
}, {
48-
devtools: 'localhost:1234'
4953
})
5054
55+
const app = new App(config)
56+
5157
export default app
5258
`,
5359
},

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,7 @@ h(Example, { name: "guide/getstarted/devtools" })
8080

8181
The Overmind devtools is a pretty amazing experience. You get insight into all the state, changes to that state, actions run, side effects run and general stats. This visual overview becomes more and more valuable as well as complexity increases in your application.
8282

83-
To connect to the devtools simply add the option to your application:
84-
85-
```marksy
86-
h(Example, { name: "guide/getstarted/devtoolsConnect" })
87-
```
83+
To connect to the devtools simply start the devtools application and refresh your app.
8884

8985
## Summary
9086

0 commit comments

Comments
 (0)