2015-04-10 20:17:03 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-04-12 22:41:09 +00:00
|
|
|
define([
|
2015-04-12 22:56:47 +00:00
|
|
|
'underscore', 'react', 'socketio', 'dataio'
|
2015-04-12 22:41:09 +00:00
|
|
|
], function(
|
2015-04-12 22:56:47 +00:00
|
|
|
_, React, socketio, dataio
|
2015-04-12 22:41:09 +00:00
|
|
|
) {
|
2015-04-12 22:56:47 +00:00
|
|
|
var contentEl = window.document.getElementById('content');
|
|
|
|
|
2015-04-12 22:41:09 +00:00
|
|
|
// console.log(React, socketio, dataio);
|
|
|
|
var connect = dataio(socketio.connect());
|
|
|
|
|
|
|
|
var projects = connect.resource('projects');
|
|
|
|
projects.sync('read', function(err, projects) {
|
2015-04-12 22:56:47 +00:00
|
|
|
contentEl.innerHTML = (
|
|
|
|
(err && err.message) ||
|
|
|
|
('Loaded projects: ' + _(projects).pluck('name').join(', '))
|
|
|
|
);
|
2015-04-12 22:41:09 +00:00
|
|
|
});
|
2015-04-10 20:17:03 +00:00
|
|
|
});
|