How to use the can-connect/can/tag/ function in can-connect

To help you get started, we’ve selected a few can-connect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marshallswain / AmityApp / public / src / models / server.js View on Github external
define: {}
});

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

export const serverConnection = superMap({
  url: '/amity/servers',
  idProp: 'name',
  Map: Server,
  List: Server.List,
  name: 'server'
});

tag('server-model', serverConnection);

socket.on('servers created', server => serverConnection.createInstance(server));
socket.on('servers updated', server => serverConnection.updateInstance(server));
socket.on('servers removed', server => serverConnection.destroyInstance(server));

console.log(serverConnection.getList);

export default Server;