bgrins/itchpad — pull request #39 by bgrins (2014-03-28 16:16:45+00:00)
Title: Add .onReady function

@harthur this change makes it so that the interface is a bit easier to work with. After this change, to call setProjectToSinglePath, it would look like this:

const {Itchpad} = require("itchpad");
let itchpad = Itchpad(iframe);
itchpad.onReady(() => {
itchpad.setProjectToSinglePath("/some/path");
});

What do you think? Is there a better way to deal with this async stuff in this case (can't call setProjectToSinglePath until onLoad is finished). I guess we could wrap the constructor inside of an exported function that returns a promise?