WaterfallEngineering/SpookyJS — pull request #123 by nodar-chkuaselidze (2014-12-05 07:25:15+00:00)
Title: evaluateInCasper

The Problem:
Casper goes to the website, takes some Image, it sends image to node via Emit and processes it to get some data from it, then it wants to send back and do some actions on the page based on that data..

so Casper waitsFor data to get back.. something like this:
```js
spooky.waitFor(function () {
return typeof window.data === 'object';
});
```
So while waiting we want to update window.data from node, casper steps are paused.. After digging I found answer from @lawnsea in issue #25 and decided to test it.. So here it is:
```js
spooky.evaluateInCasper([{
data : parsedData
}, function () {
window.data = data;
}]);
```

it updates `window.data` and `waitFor` continues to next steps.

There's one **Note: it works only with HTTP Transport**