shape
Transforms one or several Spots into a new value. Works inside run.context, enabled.context, and createWire.from.
shape<S, T>(spot, fn)— Returns aSpot<T>.fnreceives the value ofspotshape<S, T>(sources, fn)— Returns aSpot<T>from a record or array ofSpots.fnreceives an object or array of their valuesshape<T>(sources)— Returns aSpot<T>without remapping the value of record or array ofSpots, only grouping them into oneSpot.
shape(user.result, (u) => u.name.toUpperCase())
shape({ first: firstName.result, last: lastName.result }, (v) => `${v.first} ${v.last}`)
shape([firstName.result, lastName.result], ([first, last]) => `${first} ${last}`)
shape({ first: firstName.result, last: lastName.result }) // Spot<{ first: string; last: string }>When shape fails, the downstream Task skips — the source Task fails, or the callback throws