Jump to content



Recommended Posts

hi , i think you made a wrong title , this is not a chaining function in js !?
A chaining function it a method thats return itself to call other self method.

in your first code , you pass anonymous function in the event scope context ??, this make no sence!
A context is the `this` `bind` of your method you want for the event execution.
You also can debug your code in multiple way...
In this example you can see i pass scope this `default` for first and a objet for the second.
In you can also see the parameter you can pass.

ps: you can not compare jquery api with pixi api !!! 
each API has their ideology on their code.

Link to comment
Share on other sites

1 hour ago, [email protected] said:

The whole idea of having "on" is so that you can chain them:

With Pixi API EventEmitter.on is a straight alias to EventEmitter.addEventListener.  Yes, "event" is a simple, singular key with no implied ability to be multiple.  That's a good thing because it implies a particular type of Event with specific meta data (e.g. what the mouse did vs what the keyboard did are probably quite different?).

Whereas allowing a semi-magical string that may represent comma (or space, or comma+space) delimitation is an inferior interface because it is vague and must abstract the returned Event data as a result.  If multi-event binding is a desired behavior for a project then it's quite trivial to override, overload or add a helper function to handle that.  And probably better to use something other than a string if doing multiplies?  But don't.  Instead be very specific about Events, use them minimally and remember to be fastidious about clean-up afterwards.

About those shoes ... Pixi is the sole, it's minimal and optimal.  Use it as a core that can be extended as and when needed - such extension is often better achieved by the developers who are close to their specific design requirements.  Good luck!

Link to comment
Share on other sites

On 4/6/2019 at 1:13 AM, [email protected] said:


: I love your reply, PIXIJS is the sole, made me laugh.

Coming from JQuery, I still find this a little unacceptable but I appreciate your alignment with PIXIJS's ideology and sharing your thoughts with me.

@[email protected] You should be more careful with your words. Its not that we have special ideology, its that we all come from different tech backgrounds and ideologies: we put something in PixiJS only if many people agree that our apps benefit from it, not because it looks cool. Make a plugin that adds chaining and you'll satisfy all jquery-lovers, eh... if you find them here. Chaining is unnecessary but if we integrate it we will be very difficult to remove it from the project in favor of more advanced coding styles. Many API's walked into that trap.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...