Tuesday, 15 March 2011

javascript - Nodeschool's Stream-Adventure #12 Duplexer redux -


This is the day because I am trying to solve this practice in several ways. I give up. What am I doing wrong here ? Why am I getting "write after the end" error if I am using "end" event and I do not write anything to the pipes? After using it I am changing an object or at least I feel like this.

  requires var duplexer2 = ("Duplex 2"); Var = Required ('through2'); Module.exports = Function (counter) {var country = {}; Var Duplex = Duplex 2 (via .obj (function (obje, encoding, done) {if (country in the obj country) countries [ozjount] ++; other country [abijentry] = 1; done ();}) , the counter); Duplex.On ("Finnish", Function () {Counter.Sistent (Country);}); Counter.pipe (duplex); Return duplex; };  

If I change the option of line counter.setcounts (countries), then console.log (country) That is it's population correctly.

Problems with the problem:

I have read this practice test file and it does not get any clue because it only compares the items to see if they are correct Are there.

Your solution is almost right; just remove the counter.pipe (duplex); line and it does not need to pipe anything in the duplex section created by you, the stream is going to do so that it works to check that it works :).


No comments:

Post a Comment