MCPcopy Create free account
hub / github.com/effector/effector / unitObjectName

Function unitObjectName

src/effector/naming.ts:6–24  ·  view source on GitHub ↗
(objOrArr: any, method: string = 'combine')

Source from the content-addressed store, hash-verified

4import {forIn} from './collection'
5
6export function unitObjectName(objOrArr: any, method: string = 'combine') {
7 let name = method + '('
8 let comma = ''
9 let i = 0
10 forIn(objOrArr, unit => {
11 /* inlined max object names constant */
12 if (i < 25) {
13 if (unit != null) {
14 name += comma
15 name += is.unit(unit)
16 ? getCompositeName(unit as CommonUnit | Domain).fullName
17 : (unit as any).toString()
18 }
19 i += 1
20 comma = ', '
21 }
22 })
23 return name + ')'
24}
25
26export function setStoreName<State>(store: Store<State>, rawName: string) {
27 store.shortName = rawName

Callers 3

mergeFunction · 0.90
storeCombinationFunction · 0.90
naming.test.tsFile · 0.90

Calls 2

forInFunction · 0.90
getCompositeNameFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…