Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple question about .first() #1967

Open
tacman opened this issue Apr 27, 2024 · 0 comments
Open

simple question about .first() #1967

tacman opened this issue Apr 27, 2024 · 0 comments

Comments

@tacman
Copy link

tacman commented Apr 27, 2024

I'm still struggling with Promises.

What am I doing wrong here? It seems so simple, but I'm fighting. count works, first doesn't.

        db.tables.forEach(t=>{
            t.count(c => console.error('count of ' + t.name + ' is  ' + c));
            t.first(item => console.error(item));
            t.first()
                .then(item => console.error(item))
                .catch(err => console.error(err))
                .finally(() => console.log('finally!'))
        });

I'm not even sure how to debug this. Sorry for such a simple question. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant