I read alot of topics, went through alot of JS plugins on github, and alot of them have their own way of structuring code and which pattern to use. In some cases there is obvious why he went that way. But when dealing with smaller stuff, not big SAP, which pattern have most "pros" to go with?
For now, i am going this way: http://ift.tt/1OvrmKR
Yes, it works just fine, but i am wondering for smaller plugins, especially the ones that are just manipulating DOM (creating new elements/moving around/adding events listeners etc...), what would be best pattern to go with and of course why? Maybe I dont need to pollute namespace for small stuff.
Link to the JS component (not jQuery) that was written well would also help.
Aucun commentaire:
Enregistrer un commentaire