From what I understand of the code, it's not possible to pass functions as parameters into evalSync for the client... because the parameters eventually get stringified by phantom and that means only valid JSON types can be passed.
Obviously this isn't going to work, because "helpers" isn't defined after the evalSync function is injected. I don't want to put the emit in the helpers.initialise function because I'm trying to keep my library code free from the concept of Laika.
I tried some closure tricks, but I always ended up clobbering the scope for either 'helpers.initialise' or the 'emit'.
From what I understand of the code, it's not possible to pass functions as parameters into evalSync for the client... because the parameters eventually get stringified by phantom and that means only valid JSON types can be passed.
I'm trying to achieve something like this...
Obviously this isn't going to work, because "helpers" isn't defined after the evalSync function is injected. I don't want to put the emit in the helpers.initialise function because I'm trying to keep my library code free from the concept of Laika. I tried some closure tricks, but I always ended up clobbering the scope for either 'helpers.initialise' or the 'emit'.
Hoping for some input on this one.