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

Function values

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

Source from the content-addressed store, hash-verified

38export function values<T>(ar: IObservableArray<T>): ReadonlyArray<T>
39export function values<T = any>(obj: T): ReadonlyArray<T extends object ? T[keyof T] : any>
40export function values(obj: any): string[] {
41 if (isObservableObject(obj)) {
42 return keys(obj).map(key => obj[key])
43 }
44 if (isObservableMap(obj)) {
45 return keys(obj).map(key => obj.get(key))
46 }
47 if (isObservableSet(obj)) {
48 return Array.from(obj.values())
49 }
50 if (isObservableArray(obj)) {
51 return obj.slice()
52 }
53 die(6)
54}
55
56export function entries<K, T>(map: ObservableMap<K, T>): ReadonlyArray<[K, T]>
57export function entries<T>(set: ObservableSet<T>): ReadonlyArray<[T, T]>

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
valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…