Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Simplify Engine constructor
The Engine class is riddled with type errors, which has been making the controller updates difficult. In attempting to address these errors, one of the first obstacles was the conditional constructor. The types for the class would be a lot simpler if we could assume that certain properties were always initialized, but the condition prevents that. The condition was meant to ensure that only one global Engine instance was ever constructed. This check has been moved to the `init` function at the end of the file instead. This has the same effect, as that function is the only place the Engine class is constructed (it's not exported). This is much easier for TypeScript to understand. This relates to MetaMask/mobile-planning#1015
- Loading branch information