Skip to content

Commit 6e990bb

Browse files
Merge branch 'next' of https://github.com/cerebral/overmind into next
2 parents d938139 + f9fff8f commit 6e990bb

File tree

3 files changed

+39
-31
lines changed

3 files changed

+39
-31
lines changed

packages/node_modules/overmind-devtools-vscode/package.json

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,35 @@
4040
"description": "Enable devmode. Will serve client from specified url",
4141
"type": "boolean"
4242
},
43-
"commands": [
44-
{
45-
"category": "Overmind Devtools",
46-
"command": "overmind-devtools.start",
47-
"title": "Start"
48-
}
49-
]
50-
},
51-
"scripts": {
52-
"vscode:prepublish": "webpack --mode production",
53-
"compile": "webpack --mode none",
54-
"watch": "webpack --mode none --watch",
55-
"postinstall": "node ./node_modules/vscode/bin/install",
56-
"build": "rimraf devtoolsDist && cp -R ../overmind-devtools-client/dist devtoolsDist",
57-
"distribute": "npm run build && vsce publish -p $TOKEN"
58-
},
59-
"devDependencies": {
60-
"@types/node": "^12.11.6",
61-
"tslint": "^5.12.1",
62-
"vscode": "^1.1.36"
43+
"overmind.logging.verbose": {
44+
"default": false,
45+
"description": "Toggles verbose logging",
46+
"type": "boolean"
47+
}
48+
}
6349
},
64-
"peerDependencies": {
65-
"overmind-devtools-client": "next"
66-
}
50+
"commands": [
51+
{
52+
"category": "Overmind Devtools",
53+
"command": "overmind-devtools.start",
54+
"title": "Start"
55+
}
56+
]
57+
},
58+
"scripts": {
59+
"vscode:prepublish": "webpack --mode production",
60+
"compile": "webpack --mode none",
61+
"watch": "webpack --mode none --watch",
62+
"postinstall": "node ./node_modules/vscode/bin/install",
63+
"build": "rimraf devtoolsDist && cp -R ../overmind-devtools-client/dist devtoolsDist",
64+
"distribute": "npm run build && vsce publish -p $TOKEN"
65+
},
66+
"devDependencies": {
67+
"@types/node": "^12.11.6",
68+
"tslint": "^5.12.1",
69+
"vscode": "^1.1.36"
70+
},
71+
"peerDependencies": {
72+
"overmind-devtools-client": "next"
73+
}
6774
}

packages/node_modules/overmind/src/statemachine.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ describe('Statemachine', () => {
208208
FOO: ['BAR'],
209209
BAR: ['FOO']
210210
}, {
211-
state: 'FOO'
211+
state: 'FOO',
212212
})
213213
const transition: Action = async ({ state }) => {
214214
if (state.transition('BAR')) {
@@ -224,6 +224,8 @@ describe('Statemachine', () => {
224224
}
225225
}
226226

227+
228+
227229
const config = {
228230
state,
229231
actions: {

packages/node_modules/overmind/src/statemachine.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ export type StatemachineTransitions<States extends TStates> = {
1212

1313
export interface MachineMethods<States extends TStates> {
1414
matches<T extends States["state"]>(state: T): this is Statemachine<States, States extends {
15-
state: T;
15+
state: T
1616
} ? States : never>;
17-
transition<State extends States["state"]>(
18-
state: State,
19-
): this is Statemachine<States, States extends {
20-
state: State
17+
transition<T extends States["state"]>(
18+
state: T,
19+
): undefined | Statemachine<States, States extends {
20+
state: T
2121
} ? States : never>
2222
}
2323

@@ -41,11 +41,10 @@ class StateMachine<States extends TStates, State extends TStates = States> {
4141
tree.enableMutations()
4242
this.state = state
4343
Promise.resolve().then(() => tree.blockMutations())
44-
return true
44+
return this
4545
} else if (process.env.NODE_ENV === 'development') {
4646
console.warn(`Overmind Statemachine - You tried to transition into "${state}", but it is not a valid transition. The valid transitions are ${JSON.stringify(transitions[this.state])}`)
4747
}
48-
return false
4948
}
5049
matches(state) {
5150
if (state === this.state) {

0 commit comments

Comments
 (0)