Instead of creating a Redis client inside the data store, one could simply be passed into it. This would remove the need to track if Redis was loaded or not.
# before
data_store = Stoplight::DataStore::Redis.new(url: 'redis://...')
# after
redis = Redis.new(url: 'redis://...')
data_store = Stoplight::DataStore::Redis.new(redis)
That would free up the data store to accept actual options, like which key prefix to use.
Instead of creating a Redis client inside the data store, one could simply be passed into it. This would remove the need to track if Redis was loaded or not.
That would free up the data store to accept actual options, like which key prefix to use.