Skip to content

Commit

Permalink
Remove notion from typescript in assemblyManager that assemblyManager…
Browse files Browse the repository at this point in the history
….addAssembly can take a snapshot
  • Loading branch information
cmdcolin committed Feb 19, 2021
1 parent 1956a70 commit 2542959
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/core/assemblyManager/assemblyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import {
cast,
getParent,
IAnyType,
SnapshotOrInstance,
types,
Instance,
types,
} from 'mobx-state-tree'
import { when } from '../util'
import { readConfObject } from '../configuration'
Expand Down Expand Up @@ -151,19 +150,19 @@ export default function assemblyManagerFactory(
),
)
},

// this can take an active instance of an assembly, in which case it is
// referred to, or it can take an identifier e.g. assembly name, which is
// used as a reference. snapshots cannot be used
addAssembly(
assemblyConfig: SnapshotOrInstance<typeof assemblyConfigType> | string,
assemblyConfig: Instance<typeof assemblyConfigType> | string,
) {
self.assemblies.push({ configuration: assemblyConfig })
},
// addAssemblyConf(
// assemblyConfig: SnapshotOrInstance<typeof assemblyConfigType> | string,
// ) {
// self.assemblies.push({ configuration: assemblyConfig })
// }

replaceAssembly(
idx: number,
assemblyConfig: SnapshotOrInstance<typeof assemblyConfigType> | string,
assemblyConfig: Instance<typeof assemblyConfigType> | string,
) {
self.assemblies[idx] = cast({
configuration: assemblyConfig,
Expand Down

0 comments on commit 2542959

Please sign in to comment.