Use a storage singleton
This way the instance can be reused, which allows access to non-deprecated `DataFormat` and `AssetType`.
This commit is contained in:
1 parent
ceb39f366c
commit
adb31ea8d3
2 files changed
+5
-3
No files matched your search
+3
-1
@@ -26,4 +26,6 @@ class Storage extends ScratchStorage {
|
||||
}
|
||||
}
|
||||
|
||||
export default Storage;
|
||||
const storage = new Storage();
|
||||
|
||||
export default storage;
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import VM from 'scratch-vm';
|
||||
import Storage from '../lib/storage';
|
||||
import storage from '../lib/storage';
|
||||
|
||||
const SET_VM = 'scratch-gui/vm/SET_VM';
|
||||
const defaultVM = new VM();
|
||||
defaultVM.attachStorage(new Storage());
|
||||
defaultVM.attachStorage(storage);
|
||||
const initialState = defaultVM;
|
||||
|
||||
const reducer = function (state, action) {
|
||||
|
||||
Reference in new issue
Block a user