-
Ray Schamp authored
This way the instance can be reused, which allows access to non-deprecated `DataFormat` and `AssetType`.
Ray Schamp authoredThis way the instance can be reused, which allows access to non-deprecated `DataFormat` and `AssetType`.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
vm.js 556 B
import VM from 'scratch-vm';
import storage from '../lib/storage';
const SET_VM = 'scratch-gui/vm/SET_VM';
const defaultVM = new VM();
defaultVM.attachStorage(storage);
const initialState = defaultVM;
const reducer = function (state, action) {
if (typeof state === 'undefined') state = initialState;
switch (action.type) {
case SET_VM:
return action.vm;
default:
return state;
}
};
const setVM = function (vm) {
return {
type: SET_VM,
vm: vm
};
};
export {
reducer as default,
setVM
};