mobx-keystone
Version:
A MobX powered state management solution based on data trees with first class support for TypeScript, snapshots, patches and much more
14 lines (13 loc) • 643 B
TypeScript
/**
* Iterates through all children and collects them in a set if the
* given predicate matches.
*
* @param root Root object to get the matching children from.
* @param predicate Function that will be run for every child of the root object.
* @param [options] An optional object with the `deep` option (defaults to `false`) set to `true` to
* get the children deeply or `false` to get them shallowly.
* @returns A readonly observable set with the matching children.
*/
export declare function findChildren<T extends object = any>(root: object, predicate: (node: object) => boolean, options?: {
deep?: boolean;
}): ReadonlySet<T>;