import { state } from "./model";
console.log(state.foo);
const myAction = () => {
state.foo += 1;
}
you will get a runtime error say that you can't read foo of undefined. Instead of removing the state import after transpilation, we should keep it and make everything on the imported ctx a proxy that will show a nice error message.
If you have the transpiler setup and have
you will get a runtime error say that you can't read foo of undefined. Instead of removing the
state
import after transpilation, we should keep it and make everything on the importedctx
a proxy that will show a nice error message.