Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Latest commit

 

History

History
47 lines (37 loc) · 988 Bytes

index.md

File metadata and controls

47 lines (37 loc) · 988 Bytes

$get projection

Returns a value from an object structure, addressed by path

Signature

path (String/Array) - Path to the property, that should be retrieved

subject (Object) - The object that contains the requested value

TYPE SIGNATURES

String -> Object -> *
(String, Object) -> *
Array -> Object -> *
(Array, Object) -> *

EXAMPLE

const myObject = {
	rooms: {
		kitchen: {
			refrigerator: [
				'eggs',
				'beer',
				'milk'
			]
		}
	}
};

$get('rooms.kitchen.refrigerator.1', myObject); // returns 'beer'

IMMUTABLE JS SUPPORT (DEPRECATED)

WARNING: Immutable JS support is deprecated. It will be removed entirely with the next major version of Plow JS (which will be 4.0.0). Until then, support for Immutable JS versions below (but not including) v4 - though discouraged - continues to work.

the following types are supported for values targeted by path:

Iterable.Indexed
Iterable.Keyed
Iterable.Set