Created
July 21, 2014 21:36
-
-
Save Sigmus/85c6a79d275827fded3e to your computer and use it in GitHub Desktop.
A small module that replaces it's parent element content with the provided html.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
module.exports = _.curry(replaceParent, 2); | |
function replaceParent(element, html) { | |
var parent = element.parentNode; | |
parent.innerHTML = html; | |
return parent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment