Skip to content

Instantly share code, notes, and snippets.

View angelogulina's full-sized avatar
💭
🦊

Angelo Gulina angelogulina

💭
🦊
View GitHub Profile
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@angelogulina
angelogulina / fela.js
Last active February 23, 2017 17:49 — forked from robinweser/fela.js
Styles as functions of state
import { createRenderer, render } from 'fela'
// creates a new renderer to render styles
const renderer = createRenderer()
// rules are just plain functions
// returning a valid style object
const rule = state => ({
color: state.follower >= 20 ? 'green' : (state.follower >= 10 ? 'yellow' : 'red')
})