Skip to content

Commit ae2acf9

Browse files
fix(overmind): check actual plain object when processing state
1 parent 2aa1bc2 commit ae2acf9

File tree

1 file changed

+3
-8
lines changed
  • packages/node_modules/overmind/src

1 file changed

+3
-8
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@ import ActionClass, {
1010
} from './Action'
1111
import Derived from './derived'
1212
import Devtools, { Message, safeValue } from './Devtools'
13-
import {
14-
DynamicModule,
15-
EventType,
16-
Events,
17-
Options,
18-
SubType,
19-
} from './internalTypes'
13+
import { DynamicModule, EventType, Events, Options } from './internalTypes'
2014
import Reaction from './reaction'
15+
const isPlainObject = require('is-plain-object')
2116

2217
export { modules } from './modules'
2318

@@ -387,7 +382,7 @@ export default class App<
387382
private processState(state: {}) {
388383
return Object.keys(state).reduce((aggr, key) => {
389384
const value = state[key]
390-
if (typeof value === 'object') {
385+
if (isPlainObject(value)) {
391386
aggr[key] = this.processState(value)
392387
} else if (typeof value === 'function') {
393388
aggr[key] = new Derived(value)

0 commit comments

Comments
 (0)