fromProp()function

fromProp(key: K, value: V): { readonly [KK in K]: V }
ParamType
keyK
The key of the prop to set. required
valueV
The value of the prop to set. required
Return
{ readonly [KK in K]: V }
A new object containing only the single prop.

Create an object from a single prop.

Examples

fromProp("a", 1); // { a: 1 }