Re: Pengine url
Jan Wielemaker <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
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