These are chat archives for canjs/canjs

6th
Jan 2017
Nico R.
@nriesco
Jan 06 2017 02:52
I’m very confused… I had an error and it took me about a week to figure it out..
Kevin Phillips
@phillipskevin
Jan 06 2017 02:52
what was the error?
Nico R.
@nriesco
Jan 06 2017 02:53
it seesm that return MyObject.getList({}); works different than return MyObject.getList();
Kevin Phillips
@phillipskevin
Jan 06 2017 02:54
what is MyObject?
Nico R.
@nriesco
Jan 06 2017 02:54
but only when creating or deleting elements, updates work fine
sorry, myModel
in this case is a Story model
import can from 'can';
import superMap from 'can-connect/can/super-map/';
import tag from 'can-connect/can/tag/';
import 'can/map/define/define';
import feathers from '../models/feathers';

export const Story = can.Map.extend({
  define: {}
});

Story.List = can.List.extend({
  Map: Story,
}, {});

export const storyConnection = superMap({
  url: feathers.socketio('stories'),
  idProp: '_id',
  Map: Story,
  List: Story.List,
  name: 'story'
});

tag('story-model', storyConnection);

var modelName = 'stories';
feathers.io.on(modelName + ' created', data => storyConnection.createInstance(data));
feathers.io.on(modelName + ' updated', data => storyConnection.updateInstance(data));
feathers.io.on(modelName + ' patched', data => storyConnection.updateInstance(data));
feathers.io.on(modelName + ' removed', data => storyConnection.destroyInstance(data));

export default Story;
this is a donejs project using canjs 2.x
can-connect: 0.5.5
Nico R.
@nriesco
Jan 06 2017 02:59
can: 2.3.28
Kevin Phillips
@phillipskevin
Jan 06 2017 03:02
ok, I’d have to look into what getList() does
I’m not sure what is supposed to happen if you don’t pass a set
you should open an issue in can-connect though
so we can document it so that it doesn’t cost other people a week of debugging also
Nico R.
@nriesco
Jan 06 2017 03:04
sure!
there is another thing..
well no thing but fact
the socket event was triggered
so storyConnection.updateInstance was not working ok
is that part of can-connect?
Kevin Phillips
@phillipskevin
Jan 06 2017 03:05
yes
Nico R.
@nriesco
Jan 06 2017 03:06
ok
I’ll replicate the error on a simplified version of this app and create an issue
Kevin Phillips
@phillipskevin
Jan 06 2017 03:06
ok thanks
Nico R.
@nriesco
Jan 06 2017 03:09
now my app works so smoothly.. :-)
Kevin Phillips
@phillipskevin
Jan 06 2017 03:12
great!
Thomas Sieverding
@Bajix
Jan 06 2017 16:10
@matthewp The bug has to do w/ path resolution during build. I use directories.lib, and my build was building into dist/cms then Steal was trying to load relative to dist/assets, where assets is my directories.lib
Matthew Phillips
@matthewp
Jan 06 2017 16:12
hm, is there a bug?
Thomas Sieverding
@Bajix
Jan 06 2017 16:12
Well it’s breaking bundling for me
If you’d like to screen share, maybe I could show you?
Matthew Phillips
@matthewp
Jan 06 2017 16:14
yeah sure
Thomas Sieverding
@Bajix
Jan 06 2017 16:14
Screen Hero?
Matthew Phillips
@matthewp
Jan 06 2017 16:15
yeah
Thomas Sieverding
@Bajix
Jan 06 2017 16:16
My handle is Bajix