Rocket Logo Stoxy Docs Guides Toggle darkmode

Methods: Where

Returns object(s) from a state object matching a predicate.

Allows for reading a filtered take from the state object.

Params

NameAttribute
keyKey in string form. Used as the name of the state object
predicateThe Predicate by which the objects are filtered

Returns

A promise which resolves to the read result of the object: {any}

Usage

import { where } from '@stoxy/core';

// Find products with price below 5
where("shoppingcart", product => product.price <= 5);