fromProp()function
fromProp(key: K, value: V): { readonly [KK in K]: V }| Param | Type | |
|---|---|---|
key | K | The key of the prop to set. required |
value | V | 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 }