some
some checks a list of Tasks, Tags, or Spots for any item that matches one condition. Without it, you’d build the same shape by hand:
// without someconst anyEven = shape([fetchUser.result, fetchOrder.result], (results) => results.some((result) => result.id % 2 === 0),)
// with someconst anyEven = some([fetchUser, fetchOrder], (task) => task.result.id % 2 === 0)Arguments
Section titled “Arguments”list— Tasks, Tags, and Spots to check. A mix is fine.predicate— runs once per item. A Task is unwrapped to{ result, status, error }; a Tag or Spot, to its value. Must return aboolean.
Returns
Section titled “Returns”Spot<boolean> — true when any item satisfies predicate; false otherwise.
some.status
Section titled “some.status”some.status checks whether any Task in a list reached a given status. Without it, you’d write that as the some predicate by hand:
// without someconst anyDone = shape([fetchUser.status, fetchOrder.status], (statuses) => statuses.some((status) => status === "done"),)
// with someconst anyDone = some([fetchUser, fetchOrder], (task) => task.status === "done")
// with some.statusconst anyDone = some.status([fetchUser, fetchOrder], "done")Arguments
Section titled “Arguments”list— Tasksstatus— theTaskStatusat least one Task must reach.
Returns
Section titled “Returns”Spot<boolean> — true when any Task reached status; false otherwise.