Comments (1)
No one wants Promises,
Please speak for yourself. I want promises, where they make sense and that is in 99% of TypeScript/ JavaScript code being written. They are an integral part of Node/ JavaScript to make use of JavaScript's event loop in order to stop code from blocking processing.
it all came from functional javascripter's non fluent in Object Oriented modeling and closure camp's and I have seen whole companies bit the dust and go chapt 11 from their widespread impact of chaos async threads and inability to get any of it under control
Not using Promises in TypeScript/JavaScript won't make the code more object oriented. There is no such thing as "async threads" in JavaScript. In fact, Promises or async/ await code is exactly what makes JavaScript so simple to use. Much better than the old days where there were only callbacks.
instead of hardwiring everything onto promises and async/await.
Nothing is hardwired. It's how JavaScript works. Offering Observables is not going to make any JavaScript code more efficient or better.
Let's also take a step back. Observables are part of event management. i.e. certain objects can listen or produce events via working with observables. It's called reactive programming. It is a different paradigm than OOP, whereas OOP can make use of reactivity. What you are asking for is reactive features to Mongoose, which Mongoose itself doesn't support (maybe, more below). Remember, this package (nestjs-typegoose) is a wrapper to get Typegoose working in NestJS and Typegoose is a wrapper for Mongoose. If anything, you should be asking the Mongoose team for this change. And, I'll bet they'll basically ignore it.
Btw, there is a "bit" of reactive programming in Mongoose with "watching".
https://mongoosejs.com/docs/api.html#connection_Connection-watch
https://mongoosejs.com/docs/api.html#model_Model.watch
Or with their hooks system within Middleware:
https://mongoosejs.com/docs/middleware.html
Your ask here is incorrectly placed as mentioned above. And, also instead of thinking you know the solution is to work with Observables, you might want to go to a place like StackOverflow/ StackExchange and present your current challenge and hopefully get people with a lot of knowledge to reply. I'll bet you a beer, they don't end up with saying some package will need to change and offer Observables to solve your problem.
Scott
from nestjs-typegoose.
Related Issues (20)
- Controller passes the test whereas the services level test don't
- Models with the same name HOT 1
- some error
- Incompatibility with the typegoose model
- Typegoose library hook errors.....Generic type HOT 2
- InjectModel brake on mongoose 5.12.9 and higher HOT 6
- Dependency Injection Inside a Pre save hook HOT 1
- Support/ update to NestJS v8 and others HOT 17
- Discriminator properties not working, only base class.
- MongooseError: Operation `xxx.find()` buffering timed out after 10000ms
- Mongoose version 6.0.5, without usenewurlparser parameter
- Mongoose 6.x Support Issue - no exported member 'ConnectionOptions' HOT 1
- 'useNewUrlParser' does not exist in type 'TypegooseConnectionOptions' HOT 4
- Can not install module HOT 5
- Dependency Dashboard
- Package maintenance HOT 5
- Using the same models in InjectModel HOT 1
- InjectConnection not supported?
- Not support new @nestjs/common 10 version HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nestjs-typegoose.