diff --git a/src/index.js b/src/index.js index b013521..c41be4d 100644 --- a/src/index.js +++ b/src/index.js @@ -7,20 +7,27 @@ var app = {}; app.render = engine.render; app.CONST = engine.CONST; app.renderFile = (filePath) => { + this.setState({ status: 0, statusMSG: "read file" }); let file = fs.readFileSync(filePath, "utf8"); + this.setState({ status: 0, statusMSG: "parse file" }); file = JSON.parse(file); + this.setState({ status: 0, statusMSG: "set Selfpath" }); file["_SELFPATH_"] = path.dirname(filePath); return engine.render(file); }; -app.setStateFunction = function (callback) { - app.stateCallback = callback; -}; app.setState = ({ status, statusMSG }) => { if (app.stateCallback != undefined) { app.stateCallback({ status, statusMSG }); } }; + +app.setStateFunction = function (callback) { + app.stateCallback = callback; + this.setState({ status: 0, statusMSG: "set Statefunction" }); + this.setState({ status: 0, statusMSG: "JSSTE is ready" }); +}; + // app.log = function({status, statusMSG}){ // };