Skip to content

Commit 6fa86cb

Browse files
fix(overmind-devtools-client): fixed issue with derived on classes
1 parent f5870ec commit 6fa86cb

File tree

1 file changed

+7
-2
lines changed
  • packages/node_modules/overmind-devtools-client/src/overmind

1 file changed

+7
-2
lines changed

packages/node_modules/overmind-devtools-client/src/overmind/operators.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,13 @@ export const updateDerived: () => Operator<DerivedMessage> = () =>
159159
const actualPath = Array.isArray(message.data.path) ? message.data.path : (message.data.path as any).split('.')
160160
const path = actualPath.slice()
161161
const key = path.pop()
162-
const target = path.reduce((aggr, pathKey) => aggr[pathKey], appState)
163-
target[key] = message.data.value
162+
const target = path.reduce((aggr, pathKey) => aggr && aggr['__CLASS__'] ? aggr[pathKey].value : aggr[pathKey], appState)
163+
164+
if (target['__CLASS__']) {
165+
target.value[key] = message.data.value
166+
} else {
167+
target[key] = message.data.value
168+
}
164169

165170
state.apps[message.appName].derived[actualPath.join(state.apps[message.appName].delimiter)] = message.data
166171
})

0 commit comments

Comments
 (0)