this I get the jist of the conversation but my Javascript skills, less than 2 months, does not allow me to be able to code this up. Also, as a starter in the new language the last thing I want to do is to miss out on the language correct way of things and force lets say the Java way of doing things in JS.
Can you show me a skeleton of such function and a tiny consumer of that? The reason I say that is the fact that all of the examples are all done in the same JS file and not setup as module and when I try to change to a module and a consumer, I run into syntax problems and .... I do not understand the difference between a class exporting an object as opposed to a constructor Thank you so much for showing me the correct way On Thursday, November 21, 2013 7:37:32 AM UTC-8, Kamil Leszczuk wrote: > > Aah, nevermind then, I misunerstood ;) > 21 lis 2013 16:36 "Gregg Caines" <gr...@caines.ca <javascript:>> > napisaĆ(a): > >> Yeah... that's what I'm saying :) >> >> G >> >> >> On Thu, Nov 21, 2013 at 7:33 AM, Kamil Leszczuk >> <kami...@gmail.com<javascript:> >> > wrote: >> >>> > For example, if I have a module for emailing with a send() method on >>> it, I don't have it export a constructor; I have it export an object. That >>> object might maintain some state or it might not. When the module is >>> subsequently require()'d, it will have any state that it has accumulated >>> since. >>> >>> For.most of the time, that's unnecessary - multiple require() calls for >>> the same module return same, cached module, so you can store state just by >>> using local variables in that module. >>> >>> -- >>> -- >>> Job Board: http://jobs.nodejs.org/ >>> Posting guidelines: >>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >>> You received this message because you are subscribed to the Google >>> Groups "nodejs" group. >>> To post to this group, send email to nod...@googlegroups.com<javascript:> >>> To unsubscribe from this group, send email to >>> nodejs+un...@googlegroups.com <javascript:> >>> For more options, visit this group at >>> http://groups.google.com/group/nodejs?hl=en?hl=en >>> >>> --- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "nodejs" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/nodejs/GmUto9AN47U/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> nodejs+un...@googlegroups.com <javascript:>. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> -- >> -- >> Job Board: http://jobs.nodejs.org/ >> Posting guidelines: >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines >> You received this message because you are subscribed to the Google >> Groups "nodejs" group. >> To post to this group, send email to nod...@googlegroups.com<javascript:> >> To unsubscribe from this group, send email to >> nodejs+un...@googlegroups.com <javascript:> >> For more options, visit this group at >> http://groups.google.com/group/nodejs?hl=en?hl=en >> >> --- >> You received this message because you are subscribed to the Google Groups >> "nodejs" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to nodejs+un...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.