Skip to content

Instantly share code, notes, and snippets.

View Christopher2K's full-sized avatar
🎯
Focusing

Christopher N. KATOYI Christopher2K

🎯
Focusing
View GitHub Profile
@Christopher2K
Christopher2K / xhr.js
Last active April 9, 2018 21:15
Exemple XHR
// Initialisation de la requête XHR
const request = new window.XMLHttpRequest();
// Options de la requête
const options = {
method: 'GET',
url: 'http://myurl.com',
async: true
};
@Christopher2K
Christopher2K / obs.js
Created December 18, 2017 23:27
Create an observable
function myDataStream(observer) {
observer.next('Hello');
observer.next('Reactive');
observer.next('World');
}
const obsOne = Rx.Observable.create(myDataStream);
const subscriptionOne = obsOne.subscribe((data) => {
console.log(`Output Obs 1 : ${data}`);
});