Skip to content

Instantly share code, notes, and snippets.

@barneycarroll
Created February 22, 2017 17:44
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 barneycarroll/52120fea1efcaa30b9f5e4038c22d716 to your computer and use it in GitHub Desktop.
Save barneycarroll/52120fea1efcaa30b9f5e4038c22d716 to your computer and use it in GitHub Desktop.
Run global side-effects in-line with Mithril's lifecycle
export default function mSideEffects(lifecycle){
m.mount(document.createDocumentFragment(), Object.assign({
view : () => ''
},
lifecycle
))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment