We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How would you wrap up redis and use it as a dependency? I created a loader for it and injected it but i have no type support or anything else?
The text was updated successfully, but these errors were encountered:
Can you share an example code?
Sorry, something went wrong.
Here is what I did with redis.
// redis.js const uitl = require('util'); const redis = require('redis'); const config = require('../config'); module.exports = () => { const client = redis.createClient(config.env.redis); client.get = uitl.promisify(client.get); return client; }; // dependencyInjector.js const { Container } = require('typedi'); const Redis = require('./redis'); module.exports = () => { Container.set('RedisClient', Redis()); };
You can find the whole code here.
No branches or pull requests
How would you wrap up redis and use it as a dependency? I created a loader for it and injected it but i have no type support or anything else?
The text was updated successfully, but these errors were encountered: