Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

feat: add async methods to CRUD operations #31

Merged

Conversation

jordanpowell88
Copy link
Contributor

Closes #23

Copy link
Member

@wesleygrimes wesleygrimes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jordanpowell88! Nice job!!

Looking through this a couple things to come to mind, what do you all think about wrapping the non-async functions and reusing them as opposed to redefining the existing logic?

So for example:

getAllAsync would become:

public getAllAsync(): Observable<T[]> {
    return of(this.getAll());
}

Copy link
Contributor

@cmwhited cmwhited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about typing the return type.

lib/services/in-memory-db.service.ts Outdated Show resolved Hide resolved
lib/services/in-memory-db.service.ts Outdated Show resolved Hide resolved
@cmwhited
Copy link
Contributor

I echo @wesleygrimes comment as well. Helps to centralize the logic.

@wesleygrimes wesleygrimes added enhancement New feature or request WIP Work In Progress labels Aug 19, 2019
@jordanpowell88
Copy link
Contributor Author

Agreed on wrapping the methods. Don’t know why I didn’t think of that originally :facepalm

@wesleygrimes
Copy link
Member

Agreed on wrapping the methods. Don’t know why I didn’t think of that originally :facepalm

It's ok, I would have done the same thing

wesleygrimes
wesleygrimes previously approved these changes Aug 20, 2019
Copy link
Member

@wesleygrimes wesleygrimes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost, just a couple tweaks.

@wesleygrimes wesleygrimes merged commit fad4cac into nestjs-addons:master Aug 21, 2019
@wesleygrimes
Copy link
Member

🎉 This PR is included in version 1.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@wesleygrimes
Copy link
Member

@all-contributors add @jordanpowell88 for code, tests

@allcontributors
Copy link
Contributor

@wesleygrimes

I've put up a pull request to add @jordanpowell88! 🎉

@jordanpowell88 jordanpowell88 deleted the feature-async-methods branch September 16, 2019 22:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request released WIP Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Add async methods to CRUD operations
3 participants