OVERMIND
v28
v28
  • Overmind
  • Introduction
  • Quickstart
  • How to learn
  • Videos
  • FAQ
  • Core
    • Devtools
    • Configuration
    • State
    • Actions
    • Effects
    • Operators
    • Server Side Rendering
    • Typescript
  • views
    • React
    • Angular
    • Vue
    • Svelte
  • Addons
    • GraphQL
    • Statechart
  • Guides
    • Using state machines
    • Using classes
    • Connecting components
    • Managing lists
    • State first routing
    • Testing
    • Connecting to React Native
  • API
    • action
    • addFlushListener
    • addMutationListener
    • createOvermind
    • createOvermindMock
    • createOvermindSSR
    • derived
    • effects
    • events
    • json
    • lazy
    • merge
    • namespaced
    • onInitializeOvermind
    • operators
    • reaction
    • rehydrate
    • statemachine
Powered by GitBook
On this page
  1. API

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
  })
)
PreviouslazyNextnamespaced

Last updated 3 years ago