Skip to content

Commit 4eafc5c

Browse files
christianalfonigitbook-bot
authored andcommitted
GitBook: [master] 2 pages modified
1 parent 950e063 commit 4eafc5c

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
## Core
1111

12+
* [Devtools](core/devtools.md)
1213
* [Configuration](core/structuring-the-app.md)
1314
* [State](core/defining-state.md)
1415
* [Actions](core/writing-application-logic.md)
1516
* [Effects](core/running-side-effects.md)
16-
* [Devtools](core/devtools.md)
1717
* [Operators](core/going-functional.md)
1818
* [Statecharts](core/statecharts.md)
1919
* [Typescript](core/typescript.md)

core/running-side-effects.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -132,35 +132,6 @@ export const onInitialize = async ({ effects }) => {
132132
Typically you explicitly communicate with effects from actions, by calling methods. But sometimes you need effects to know about the state of the application, or maybe some internal state in the effect should be exposed on your application state. Again we can take advantage of an **initialize** method on the effect:
133133

134134
{% tabs %}
135-
{% tab title="overmind/effects.js" %}
136-
```javascript
137-
// We use an IIFE to isolate some variables
138-
export const socket = (() => {
139-
_options
140-
_ws
141-
return {
142-
initialize(options) {
143-
_options = options
144-
_ws = new WebSocket('ws://...')
145-
_ws.onclose = () => options.onStatusChange('close')
146-
_ws.onopen = () => options.onStatusChange('open')
147-
_ws.addEventListener(
148-
'message',
149-
(event) => options.onMessage(event.data)
150-
)
151-
},
152-
send(type, data) {
153-
_ws.postMessage({
154-
type,
155-
data,
156-
token: _options.getToken()
157-
})
158-
}
159-
}
160-
})()
161-
```
162-
{% endtab %}
163-
164135
{% tab title="overmind/onInitialize.js" %}
165136
```typescript
166137
export const onInitialize = async ({ state, effects, actions }) => {

0 commit comments

Comments
 (0)