Skip to content

Remove config methods from Storage #9

@jlenon7

Description

@jlenon7

Description

addConfig, removeConfig and resetConfig could be a little confusing and not so performative because it creates new instances of the Driver every time one of this methods are called.

A better way to handle it is just using the Storage constructor:

const runtimeConfigs = {
  bucket: 'test',
}

const storage = new Storage(runtimeConfigs)

Or disk method:

const runtimeConfigs = {
  bucket: 'test',
}

const storage = new Storage()

storage.disk('s3', runtimeConfigs)

Both implementation are useful, because you can remove/reset the runtimeConfig in Storage using disk method, this way you don't need to create a new instance of Storage.

Package version

1.0.2

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationrefactorRefactor a past featuretestAdding missing tests or correcting existing tests

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions