Most likely to be used when a library returns a Promise, you can then chain callbacks using the then property. See the above axios examples.
Another syntax creates a Promise from scratch with a function that provides a 'resolve' and 'reject' function as parameters: new Promise( function(resolve, reject) { ... } );
Feedback
I tested a feedback tool last time https://app.gosoapbox.com/ and it worked quite well (I've since noticed that you can log on completely anonymously, you don't even have to invent a name). I might try it out again.
JS101 Future
I also want to in some way evaluate what we have done over the past three years, see what worked well, what were the challenges, and what did individual people attending get out of it. I think it's been not always consistent (which partly has to do with people coming and going) but on the other hand very flexible which allowed us to do create the app and the website together which I think was great. - But in any case I would like to hand it over to somebody if possible, or share running it next year. And I think it might be good then, to have a bit of a plan what it is going to be. - So, some kind of questionnaire imminent :)
Promises In this session we looked at Promises! @mjg17 and I did a little walkthrough using the following resources: http://devdocs.io/javascript/global_objects/promise for structure of a Promise https://ponyfoo.com/articles/es6-promises-in-depth Example for a library that uses Promises: Axios -> makes Ajax request and returns a Promise: https://github.com/axios/axios#example Some remarks about Promises:
new Promise( function(resolve, reject) { ... } );
Topic for next time: Functional Programming and ES6 Any contributions from anybody? :) Suggestion: We discuss some concepts from FP and could work through these examples: https://tech.io/playgrounds/2980/practical-introduction-to-functional-programming-with-js/pure-functions (everybody as much they want; you can of course bring own projects to work on)
App update I added something to the Wiki on how I implemented the authentication. This might not be a very good way, but I am glad it worked at all! If you clone the auth branch of the app https://github.com/CodeHubOrg/organisations-database/tree/auth, you should be able to set up authentication for when the app is run in dev mode. Worked for @mjg17 at the hack night :) The Wiki entry is here https://github.com/CodeHubOrg/organisations-database/wiki/Authentication
Feedback I tested a feedback tool last time https://app.gosoapbox.com/ and it worked quite well (I've since noticed that you can log on completely anonymously, you don't even have to invent a name). I might try it out again.
JS101 Future I also want to in some way evaluate what we have done over the past three years, see what worked well, what were the challenges, and what did individual people attending get out of it. I think it's been not always consistent (which partly has to do with people coming and going) but on the other hand very flexible which allowed us to do create the app and the website together which I think was great. - But in any case I would like to hand it over to somebody if possible, or share running it next year. And I think it might be good then, to have a bit of a plan what it is going to be. - So, some kind of questionnaire imminent :)
Hope to see many of you on Tuesday!
@CodeHubOrg/js2017