Skip to content

Instantly share code, notes, and snippets.

@thedillonb
Forked from liammclennan/gist:50d58f366b99f38f5926
Last active August 29, 2015 14:17
Show Gist options
  • Save thedillonb/4a60deaeb1a3bf0f8c2e to your computer and use it in GitHub Desktop.
Save thedillonb/4a60deaeb1a3bf0f8c2e to your computer and use it in GitHub Desktop.
Euclid usage
euclid.start([{
title: 'Home',
entry: function () {
return server.getDecks().then(function (decks) {
loginChanges();
var data = {decks: decks};
return [components.Home(data), data];
}, function () {
return [components.NotAuthenticated(), {}];
});
},
actions: {
importDemo: function () {
var props = this,
url = 'https://github.com/liammclennan/maths.wiki.git';
return server.importGitWiki(url).then(function () {
euclid.navigate('Deck', {url: encodeURIComponent(btoa(url))});
return props;
});
}
}
},
{
title: 'Login',
entry: function () {
logoutChanges();
var data = {};
return [components.LoginPage(data), data];
},
actions: {
login: function (email) {
var props = this;
return server.login(email).then(function () {
props.message = "An login email has been sent to your email address " + email + '. Check your email and follow the login link.';
return props;
});
}
}
}]);
moo moo
@thedillonb
Copy link
Author

Moo moo cow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment