merge
Allows you to merge configurations together.
overmind/index.js
1
import { merge } from 'overmind/config'
2
import * as moduleA from './moduleA'
3
import * as moduleB from './moduleB'
4
5
export const config = merge(moduleA, moduleB)
Copied!
Note that merge can be useful to combine a root configuration with namespaced or lazy configuration.
overmind/index.ts
1
import { merge, namespaced, lazy } from 'overmind/config'
2
import { state } from './state'
3
import * as moduleA from './moduleA'
4
5
export const config = merge(
6
{
7
state
8
},
9
namespaced({
10
moduleA
11
}),
12
lazy({
13
moduleB: async () => await import('./moduleB').config
14
})
15
)
Copied!
Last modified 4mo ago
Copy link