Re: Pengine url
Torbjörn Lager <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CA+Y3JZiSEGibndz=MH4YHoEr+_G7C0ybMXivY8T87MpVKWs=Tg@mail.gmail.com> |
Yes, I agree it's not a clearcut case of making things clearer and easier for developers. - Torbjörn On Sun, Feb 9, 2014 at 1:29 PM, Jan Wielemaker <[email protected]> wrote: > On 02/09/2014 01:09 PM, Torbjörn Lager wrote: >> Yes, that's a nice addition. But maybe we should consider keeping the >> event handlers separate, by grouping them like this?: >> >> var pengine = new Pengine({ >> handlers: { >> oncreate: handleCreate, >> onsuccess: handleSuccess, >> onfailure: handleFailure, >> onstop, handleStop >> }, >> server: 'http://mygame.org', >> src: ... >> }); >> >> What do you think? > > I have no opinion. I think quite a few JavaScript functions or classes > use little structuring for the configuration object. Anyone knows that > onXXX is a handler, so if you nicely group them together in the list of > properties, an extra object adds little IMHO. > > Cheers --- Jan -- Torbjörn Lager Professor of General and Computational Linguistics Department of Philosophy, Linguistics and Theory of Science University of Gothenburg Box 200, SE-405 30 Gothenburg, Sweden Phone: +46317864962