Closed yazz closed 7 years ago
Hey Zubair,
You're very close! There are just two issues here. The first is the appendAsEAVs
doesn't insert anything into your program. Instead, it takes an object (e.g. {tag: "student", name: "Zubair"}
) and inserts it as EAVs into it's first argument (e.g. ["<some id>", "tag", "student"], ["<some id>", "name", "Zubair"]
). It's meant to be used in conjunction with inputEAVs()
, like so:
let inputs = [];
witheve.appendAsEAVs(inputs, {tag: "student", name: "Archibald"});
witheve.appendAsEAVs(inputs, {tag: "student", name: "Zubair"});
eve.inputEAVS(inputs);
The second issue is that inputEAVs
expects an array of EAVs, rather than EAVs as arguments, so this: eve.inputEAVs([0,"tag","student"],[0,"name","Archibald"])
should be this:
eve.inputEAVs([[0,"tag","student"],[0,"name","Archibald"]])
One last thing to note: While there's nothing wrong with having a console log inside of your watch block, it will not fire when you'd expect it to. The block as you've written it is executed once, as soon as you make it, to generate the actual internal representation of the block. The console logs in your asDiffs()
handler will work just like you expected though.
I'm going to mark this issue as closed. If you're still having any trouble don't hesitate to reply and we'll reopen it and see what we can do.
Ok great, that works :) THANKS
I have written a small Eve program in javascript but I can't seem to get the watchers to fire: