Skip to content

Instantly share code, notes, and snippets.

View SergeyLipko's full-sized avatar

SergeyLipko

  • Kharkiv, Ukraine
View GitHub Profile
const delay = ms => new Promise(res => setTimeount(res, ms));
async function * gen() {
await delay(1000);
yield 1;
await delay(1000);
yield 2;
await delay(1000);
yield 3;
}
import React from 'react';
const names = [{name: 'Arsen'}, {name: 'Vazgen'}, {name: 'Vlad'}];
const User = ({ name, ...rest }) => {
return (
<div>
<span>
{ name }
</span>
@SergeyLipko
SergeyLipko / RN_flatList_example.js
Created May 29, 2017 18:21
Example of using RN FlatList component with pagination and pull-refreshing
import React from 'react';
import {
View,
Text,
FlatList,
StyleSheet
} from 'react-native';
import { ListItem } from 'react-native-elements';
class Users extends React.Component {
@SergeyLipko
SergeyLipko / compose.js
Last active June 3, 2017 12:23
Function composition (also with ramda )
// custom
const compose = (...functions) => data =>
functions.reduceRight((value, func) => func(value), data)
const pipe = (...functions) => data =>
functions.reduce((value, func) => func(value), data)
// with ramda
import r from 'ramda';