These are chat archives for canjs/canjs

8th
Mar 2017
lmagarian
@lmagarian
Mar 08 2017 00:54
I'm getting this error: Error: TypeError: Cannot redefine property: _instanceDefinitions
at Function.defineProperty (<anonymous>)
at defineConfigurableAndNotEnumerable (can-define.js:32)
at DefineMap.define.setup (can-define.js:712)
at DefineMap.setup (map.js:113)
at Function.newInstance (can-construct.js:289)
at DefineMap.init (can-construct.js:594)
at new DefineMap (eval at <anonymous> (can-construct.js:NaN), <anonymous>:3:32)
at Object.observable (can-define.js:818)
at Object.eval (can-define.js:708)
at each (each.js:39)
From this code: Message.get({ "id": messageId })
What does it mean, and how do I fix it?
Frank Lemanschik
@frank-dspeed
Mar 08 2017 09:17
it means you should post a issue fully described in can-define project on github
i guess
and befor that search for existing issues
Jeroen Cornelissen
@jeroencornelissen
Mar 08 2017 12:25
@justinbmeyer What does calling destroyedInstancedo? I expected that it would remove my item from the list, but it doesn’t.
I’ve set up a jsbin with how I thought it would work. See the removeAllItems function.
http://jsbin.com/noguwup/9/edit?html,js,output
Kevin Phillips
@phillipskevin
Mar 08 2017 14:33
@lmagarian what does Message look like?
@jeroencornelissen I think you just want destroy
Jeroen Cornelissen
@jeroencornelissen
Mar 08 2017 15:14
@phillipskevin no that would result in additional backend requests. I would like to prevent that from happening.
Kevin Phillips
@phillipskevin
Mar 08 2017 15:15
Oh, ok. Sorry. I remember now what you’re trying to do.
don’t you have to make those requests at some point? in order for the items to be deleted on the server.
Jeroen Cornelissen
@jeroencornelissen
Mar 08 2017 15:27
inside Item.List i have a function called destroyList that does that (as suggested by Justin)