Skip to content

Commit 31e00be

Browse files
christianalfonigitbook-bot
authored andcommitted
GitBook: [v28] 2 pages modified
1 parent 7bdfaef commit 31e00be

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

core/going-functional.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Let us look at how the operators in the search example could have been implement
6969
{% tabs %}
7070
{% tab title="overmind/operators.js" %}
7171
```typescript
72-
import {filter } from 'overmind'
72+
import { filter } from 'overmind'
7373

7474
export const setQuery = ({ state }, query) => {
7575
state.query = query

core/server-side-rendering.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ export default async (req, res) => {
8181
On the client you just want to make sure that your Overmind instance rehydrates the mutations performed on the server so that when the client renders, it does so with the same state. The **onInitialize** hook of Overmind is the perfect spot to do this.
8282

8383
{% tabs %}
84-
{% tab title="overmind/onInitialize.ts" %}
84+
{% tab title="overmind/actions.ts" %}
8585
```typescript
86-
import { OnInitialize, rehydrate } from 'overmind'
86+
import { rehydrate } from 'overmind'
8787

88-
export const onInitialize: OnInitialize = ({ state }) => {
88+
export const onInitializeOvermind = ({ state }) => {
8989
const mutations = window.__OVERMIND_MUTATIONS
9090

9191
rehydrate(state, mutations)
@@ -98,7 +98,7 @@ export const onInitialize: OnInitialize = ({ state }) => {
9898
If you are using state first routing, make sure you prevent the router from firing off the initial route, as this is not needed.
9999
{% endhint %}
100100

101-
## OnInitialize
101+
## OnInitializeOvermind
102102

103103
The `onInitializeOvermind` action does not run on the server. The reason is that it is considered a side effect you might not want to run, so we do not force it. If you do want to run an action as Overmind fires up both on the client and the server you can rather call it manually:
104104

@@ -213,7 +213,7 @@ import { createHook } from "overmind-react";
213213
export const config = {
214214
state: {},
215215
actions: {
216-
add
216+
add: {
217217
changePage({ state }, mutations) {
218218
rehydrate(state, mutations || []);
219219
}
@@ -228,7 +228,7 @@ And you are all set to get going with `overmind` and `next.js`. You can also tak
228228
229229
## Gatsby
230230
231-
When it comes to gatsby we need to prepare Overmind for static extraction and the idea is about the same.
231+
When it comes to Gatsby we need to prepare Overmind for static extraction and the idea is about the same.
232232
233233
We need first to wrap our whole app in the Overmind provider and we can do that in `gatsby-browser.js`:
234234

0 commit comments

Comments
 (0)