Wire: working example of a factory plugin

31 views
Skip to first unread message

Ben Tremblay

unread,
Dec 1, 2014, 10:37:11 PM12/1/14
to cuj...@googlegroups.com
Like others on this list I am asking how many different ways can I create new instances from some kind of "prototype" module, and would like to explore the factory plugin.

Honestly the wire spec plugin may do all I need but it seems the factory plugin is potentially more reusable in a large project where encapsulation is a virtue.

I saw the pseudocode for the Widget factory plugin but I can't figure out how to use it. The methods declared inside the factories declaration don't seem to ever get called.

Does someone have a working example I could play with?

Thanks much,

Ben

Benjamin Tremblay

unread,
Dec 2, 2014, 9:51:43 AM12/2/14
to cuj...@googlegroups.com
I was able to get a factory working based on the jQueryUi Widget factory.

I would recommend this as a good starting point.

Benjamin Tremblay
> --
> You received this message because you are subscribed to a topic in the Google Groups "cujojs" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/cujojs/WfXR4An9Zqk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to cujojs+un...@googlegroups.com.
> To post to this group, send email to cuj...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cujojs.
> To view this discussion on the web visit https://groups.google.com/d/msgid/cujojs/6b270e91-eedb-46f0-8641-f27c1a19487f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

unscriptable

unread,
Dec 2, 2014, 2:41:23 PM12/2/14
to cuj...@googlegroups.com
Hey Ben,


Is there any way we can improve the code or the docs for the jQuery widget factory?

Thanks!

-- John


On Tuesday, December 2, 2014 9:51:43 AM UTC-5, Ben Tremblay wrote:
I was able to get a factory working based on the jQueryUi Widget factory.

I would recommend this as a good starting point.

Benjamin Tremblay

Reply all
Reply to author
Forward
0 new messages