Skip to content

Instantly share code, notes, and snippets.

@typehorror
Created November 6, 2016 22:09
Show Gist options
  • Save typehorror/c38678a064fe8ab09012ec4b7bb09471 to your computer and use it in GitHub Desktop.
Save typehorror/c38678a064fe8ab09012ec4b7bb09471 to your computer and use it in GitHub Desktop.
function CSS_compute_middleware(css, next) {
if(this.foo === 'bar'){
css.padding = 0;
}
return next(css)
}
function CSS_async_compute_middleware(css, next) {
if(this.bar === 'foo'){
ajax('/api/blah').then(next)
}else{
return next(css)
}
}
reveal.css_middlewares = [
CSS_compute_middleware,
CSS_async_compute_middleware,
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment