-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial
Elliot Hesp edited this page Jul 28, 2016
·
4 revisions
This tutorial does not assume any framework or specific setup.
Install using NPM:
npm install redibox --save
Import into your project:
import RB from 'redibox';
You'll now want to create a single instance of RediBox, usually during or before your application bootstrap process.
const RediBox = new RB();
Check out the configuration page for a full list of options.
Using the RediBox instance, you're now able to listen for the broadcasted events ready
& error
.
Fired after a successful Redis connection and once all RediBox Hooks have been loaded.
RediBox.on('ready' () => {
console.log('Redis is connected');
});
Fired if the connection to Redis fails or any Hooks fail to load.
RediBox.on('ready' error => {
console.error('RediBox failed to load', error);
});