event.m() default behavior

0 views
Skip to first unread message

Jrad

unread,
Aug 18, 2010, 9:29:47 AM8/18/10
to jquery-claypool
Dear Chris,
event.m( {foo:'bar'} ) simply extends the model in claypool MVC, and
this behavior makes some inconsistencies in some cases.
This is a situation where we store an event object, and later want to
flush a new model via event.m() and use the MVC on the event. In this
case, event.m() extends previous model available in the event with the
new one! (not replacing it) and we can't use event.reset() since all
MVC history will be gone!
Are we miss-using the claypool API or we need an event.resetModel()
function? or may be changing the default behavior of event.m() ?

Thanks for your always attention to your clients,

chris thatcher

unread,
Aug 18, 2010, 10:48:44 AM8/18/10
to jquery-...@googlegroups.com
I am happy to provide this through an extension of the existing event.reset function my overloading based on the arguments object.

Would something like this be ok for you?

event.reset('m').m({abc:'this is a fresh model'});

Thatcher


--
You received this message because you are subscribed to the Google Groups "jquery-claypool" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to jquery-claypo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jquery-claypool?hl=en.




--
Christopher Thatcher

Jrad

unread,
Aug 19, 2010, 1:50:25 AM8/19/10
to jquery-claypool
Yes, That is nice.

Thanks

P.S. However my personal preference is using explicit API functions
(resetM()) instead of stringified flags (reset('m')). I think explicit/
hard conventions make API code more robust from their client
viewpoints.

On Aug 18, 5:48 pm, chris thatcher <thatcher.christop...@gmail.com>
wrote:
> > jquery-claypo...@googlegroups.com<jquery-claypool%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages