I hereby claim:
- I am christopher2k on github.
- I am christopher2k (https://keybase.io/christopher2k) on keybase.
- I have a public key ASBbLb-XbTgjxD_4tBXA5mbRgFfx4b7rGzk3BaomHEsllgo
To claim this, I am signing this object:
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}`); | |
}); |
// 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 | |
}; |
const url = 'http://myurl.com'; | |
const options = { method: 'GET' }; | |
// Appel de l'API Fetch | |
fetch(url, options) | |
.then((response) => response.json()) // Récupération des données | |
.then((data) => { // Callback de succès | |
window.alert('SUCCESS'); | |
console.log(data); | |
}) |
// with [email protected] & [email protected] | |
import { ajax } from 'rxjs/observable/dom/ajax'; | |
import { tap } from 'rxjs/operators'; | |
const request = ajax.getJSON('http://myurl.com/data') | |
.pipe( | |
tap((jsonData) => console.log(jsonData)) | |
); | |
// Appel HTTP |
// with [email protected] & [email protected] | |
import { combineLatest } from 'rxjs/observable/combineLatest'; | |
import { ajax } from 'rxjs/observable/dom/ajax'; | |
import { tap, map } from 'rxjs/operators'; | |
const BASE_URL = 'http://myurl.com'; | |
// Retour un observable AJAX formé par un argument | |
function loginUserAccordingToData({ someDataThis }) { | |
return ajax.post(`${BASE_URL}/data`, { someDataThis }) |
I hereby claim:
To claim this, I am signing this object:
class MyWidget extends StatelessWidget { | |
void _clearStackAndPush (BuildContext context) { | |
Navigator.of(context).pushNamedAndRemoveUntil( | |
'/screen-name', | |
() => false, | |
); | |
} | |
@override | |
Widget build(BuildContext context) { |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
backgroundColor: Colors.transparent, | |
elevation: 0, | |
title: const Text('Hello !'), | |
), | |
extendBodyBehindAppBar: true, |
class Widget extends StatelessWidget { | |
final GlobalKey<ScaffoldState> _drawerKey = GlobalKey(); | |
void _openDrawer () { | |
_drawerKey.currentState.openDrawer(); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( |
import 'package:flutter/material.dart'; | |
class ListViewWithExtraElements<T> extends StatelessWidget { | |
final List<T> elements; | |
final List<Widget> leadingElements; | |
final List<Widget> trailingElements; | |
final Widget Function(BuildContext context, T element) itemBuilder; | |
ListViewWithExtraElements({ | |
this.leadingElements = const [], |