Initialize Verrou with multiple storage drivers
Verrou allows you to configure multiple locking stores (drivers) and define a default driver. This architecture enables switching between drivers (e.g., using Redis in production and In-Memory for testing) without changing the application logic.
import { Verrou } from '@verrou/core'
import { redisStore } from '@verrou/core/drivers/redis'
import { memoryStore } from '@verrou/core/drivers/memory'
const verrou = new Verrou({
default: 'redis',
stores: {
redis: { driver: redisStore() },
memory: { driver: memoryStore() }
}
})