MCPcopy
hub / github.com/mobxjs/mobx / entries

Function entries

packages/mobx/src/api/object-api.ts:62–76  ·  view source on GitHub ↗
(obj: any)

Source from the content-addressed store, hash-verified

60 obj: T
61): ReadonlyArray<[string, T extends object ? T[keyof T] : any]>
62export function entries(obj: any): any {
63 if (isObservableObject(obj)) {
64 return keys(obj).map(key => [key, obj[key]])
65 }
66 if (isObservableMap(obj)) {
67 return keys(obj).map(key => [key, obj.get(key)])
68 }
69 if (isObservableSet(obj)) {
70 return Array.from(obj.entries())
71 }
72 if (isObservableArray(obj)) {
73 return obj.map((key, index) => [index, key])
74 }
75 die(7)
76}
77
78export function set<V>(obj: ObservableMap<PropertyKey, V>, values: { [key: string]: V })
79export function set<K, V>(obj: ObservableMap<K, V>, key: K, value: V)

Callers 2

object-api.jsFile · 0.85
object-api.jsFile · 0.85

Calls 7

keysFunction · 0.85
isObservableMapFunction · 0.85
dieFunction · 0.85
getMethod · 0.65
isObservableObjectFunction · 0.50
isObservableArrayFunction · 0.50
entriesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…