Skip to content

Instantly share code, notes, and snippets.

@dcposch
Created June 12, 2016 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcposch/5fb72e6dcc7f8daf503caf03856eac2f to your computer and use it in GitHub Desktop.
Save dcposch/5fb72e6dcc7f8daf503caf03856eac2f to your computer and use it in GitHub Desktop.
console.time('init')
// require() calls and early initialization
[...]
var state = State.getInitialState()
// `state.saved` is read from and written to a file. All other state is ephemeral.
// First we load state.saved, once that is done, initialize the app.
loadState(init)
function init () {
// Initialize your app
// Set up event listeners
// - Listen for IPC messages from the main process
// - Listen for drag-drop events
// - etc
// Start your React or virtual-dom render loop
// Create the DOM
[...]
// Done! Ideally we want to get here <100ms after the user clicks the app
console.timeEnd('init')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment