merge

Allows you to merge configurations together.

import { merge } from 'overmind/config'
import * as moduleA from './moduleA'
import * as moduleB from './moduleB'

export const config = merge(moduleA, moduleB)

Note that merge can be useful to combine a root configuration with namespaced or lazy configuration.

import { merge, namespaced, lazy } from 'overmind/config'
import { state } from './state'
import * as moduleA from './moduleA'

export const config = merge(
  {
    state
  },
  namespaced({
    moduleA
  }),
  lazy({
    moduleB: async () => await import('./moduleB').config
  })
)

Last updated