Usage example
const LazyListItem = () => {
const [isInView, ref] = useIntersectionObserver<HTMLDivElement>();
return (
<div ref={ref}>
{isInView ? (
export function cn(...classes: (string | undefined | null | false)[]) { | |
return classes.filter(Boolean).join(' '); | |
} |
Usage example
const LazyListItem = () => {
const [isInView, ref] = useIntersectionObserver<HTMLDivElement>();
return (
<div ref={ref}>
{isInView ? (
export const lightOrDark = (color, ratio = 155) => { | |
const hex = color.replace('#', ''); | |
const red = parseInt(hex.substr(0, 2), 16); | |
const green = parseInt(hex.substr(2, 2), 16); | |
const blue = parseInt(hex.substr(4, 2), 16); | |
const brightness = (red * 299 + green * 587 + blue * 114) / 1000; | |
return brightness > ratio ? 'light' : 'dark'; | |
}; |
"Redux forces you to write good code" - I've heard that sentence many times. | |
In fact - it's quite easy to write bad code with Redux, as I've seen many times. | |
In this talk I will show some bad practices and techniques with Redux, and how to avoid them. | |
import { Pipe, PipeTransform } from '@angular/core'; | |
import { sortBy, reverse, flow, identity } from 'lodash/fp'; | |
@Pipe({ name: 'sortBy' }) | |
export class SortByPipe implements PipeTransform { | |
transform(list, field, direction = 'DESC') { | |
return flow([ | |
sortBy([field]), |
const { flow, omit, head, set, at } = require("lodash/fp") | |
const object = { | |
id: 'CA1', | |
longName: 'The name', | |
status: 'open', | |
another1: 'value1', | |
another2: 'value2' | |
}; |
This is a proposal for a ⚡lightning talk at the Reactive 2016 conference.
🌟Star this gist if you want to see it on the conference.
Every day we work with multiple teams to build our products, communication and sync are key factors to deliver your product on time without compromising quality.
In this talk I will introduce BDSM a new mocking tool that will change the way you coordinate between client and server teams minimizing friction allowing each team to work at its own pace while keeping in sync.
// String.prototype.repeat | |
// http://jsbin.com/sifesep/edit?js,console,output | |
Object.defineProperty(String.prototype, 'repeat', { | |
value: function debug_repeat(times, returnArray) { | |
var res = []; | |
var i = 0; | |
for (i; i < times; i++) { | |
res.push(this); | |
} | |
if (returnArray) { |