1.120.0 • Published 6 months ago

@biorate/ioredis v1.120.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

IORedis

IORedis connector

Examples:

import { inject, container, Types, Core } from '@biorate/inversion';
import { IConfig, Config } from '@biorate/config';
import { IORedisConnector, IORedisConfig } from '@biorate/ioredis';

class Root extends Core() {
  @inject(IORedisConnector) public connector: IORedisConnector;
}

container.bind<IConfig>(Types.Config).to(Config).inSingletonScope();
container.bind<IORedisConnector>(IORedisConnector).toSelf().inSingletonScope();
container.bind<Root>(Root).toSelf().inSingletonScope();

container.get<IConfig>(Types.Config).merge({
  IORedis: [
    {
      name: 'connection',
      options: {
        host: 'localhost',
        port: 6379,
      },
    },
  ],
});

(async () => {
  const root = container.get<Root>(Root);
  await root.$run();

  await root.connector.current!.set('key', 'value');
  console.log(await root.connector.current!.get('key')); // value
})();

Learn

  • Documentation can be found here - docs.

Release History

See the CHANGELOG

License

MIT

Copyright (c) 2021-present Leonid Levkin (llevkin)

1.96.0

10 months ago

1.95.1

10 months ago

1.91.5

11 months ago

1.95.0

10 months ago

1.91.4

11 months ago

1.93.1

11 months ago

1.91.3

11 months ago

1.93.0

11 months ago

1.91.2

11 months ago

1.91.1

11 months ago

1.91.0

11 months ago

1.90.0

11 months ago

1.100.0

8 months ago

1.120.0

6 months ago

1.104.0

8 months ago

1.102.0

8 months ago

1.102.1

8 months ago

1.89.0

1 year ago