nestjs-addons/in-memory-db

Feature: Add async methods to CRUD operations

wesleygrimes opened this issue ยท 4 comments

The Problem

In order to provide flexibility for those using InMemoryDBService as a means for prototyping and simple APIs, we provide async versions of each CrUD method. This will allow developers to use this service and minimize changes to future downstream code since most real-world NestJS applications will return asynchronous results. We also need to be able to support more advanced features like simulate delays, offline saving, etc... Providing asynchronous methods gives us this flexibility.

Proposed Solution

The proposal is to implement async versions for each CRUD method. In keeping with the overall Angular community, the suggestion is to use RxJS Observables as opposed to Promises.

Some high-level guidance:

  • The naming convention would be to append Async to the end of the method name and return an Observable. For example, createAsync(...): Observable<T>.
  • Unit tests must be created to properly test these new async methods. We should use something like rxjs-marbles testing to assist with this.

@jordanpowell88 would you be willing to take this one on? It's the natural precursor to #12

@wesleygrimes absolutely

Iโ€™m excited for this one Jordan!

๐ŸŽ‰ This issue has been resolved in version 1.4.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€