function findFirstBookId()

in src/mutators/selectedBookId.ts [15:28]


function findFirstBookId(categoryId: string) {
    const store = getStore();

    let found: string | null = null;

    Object.keys(store.books).forEach(bookId => {
        const book = store.books[bookId];
        if (book.categoryId == categoryId && !found) {
            found = bookId;
        }
    });

    return found;
}