Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

alloy.jmk for Alloy use with TiShadow

View Readme.md

It enables you to free memory between launching TiShadow builds.

Updated based on @FokkeZB's improvements

View Readme.md
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
task("post:compile", function(event,logger) {
var fs = require("fs"),
path = require("path");
if (event.alloyConfig.deployType === 'production') {
return;
}
var existing_bits = 'Alloy.createController("index");'
var tishadow_bits =
[ 'var index = Alloy.createController("index");',
'if (typeof exports !== "undefined") {',
' exports.close = function () {',
' index.getView().close();',
' };',
'}'
].join("\n");
var appjs = path.join(event.dir.resources, "app.js");
fs.writeFileSync(
appjs,
fs.readFileSync(appjs).toString().replace(existing_bits, tishadow_bits));
});
View Readme.md
1 2 3 4
//Example app/controllers/index.js
$.index.addEventListener('close',function() {
// Add other cleanup bits hear if necessary
})
FokkeZB commented

I've posted an improved version of the code at: http://fokkezb.nl/2013/05/22/tishadow-clean-up-for-alloy/

Owner

@FokkeZB, updated based on your improvements. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.