🧼 Removes the need to pass reference to fs

This commit is contained in:
Rune Harlyk
2024-11-12 11:54:10 +01:00
parent 316b1a52cb
commit 426b4a1332
8 changed files with 8 additions and 11 deletions
+2 -3
View File
@@ -24,11 +24,10 @@ template <class T>
class FSPersistence {
public:
FSPersistence(JsonStateReader<T> stateReader, JsonStateUpdater<T> stateUpdater, StatefulService<T> *statefulService,
FS *fs, const char *filePath)
const char *filePath)
: _stateReader(stateReader),
_stateUpdater(stateUpdater),
_statefulService(statefulService),
_fs(fs),
_filePath(filePath),
_updateHandlerId(0) {
enableUpdateHandler();
@@ -98,7 +97,7 @@ class FSPersistence {
JsonStateReader<T> _stateReader;
JsonStateUpdater<T> _stateUpdater;
StatefulService<T> *_statefulService;
FS *_fs;
FS *_fs {&ESPFS};
const char *_filePath;
size_t _bufferSize;
update_handler_id_t _updateHandlerId;