every
every checks a whole list of Tasks, Tags, or Spots against one condition. Without it, you’d build the same shape by hand:
// without everyconst allEven = shape([fetchUser.result, fetchOrder.result], (results) => results.every((result) => result.id % 2 === 0),)
// with everyconst allEven = every([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 every item satisfies predicate; false otherwise.
every.status
Section titled “every.status”every.status checks that every Task in a list reached the same status. Without it, you’d write that as the every predicate by hand:
// without everyconst allDone = shape([fetchUser.status, fetchOrder.status], (statuses) => statuses.every((status) => status === "done"),)
// with everyconst allDone = every([fetchUser, fetchOrder], (task) => task.status === "done")
// with every.statusconst allDone = every.status([fetchUser, fetchOrder], "done")Arguments
Section titled “Arguments”list— Tasksstatus— theTaskStatusevery Task must reach.
Returns
Section titled “Returns”Spot<boolean> — true when every Task reached status; false otherwise.