Skip to content

Instantly share code, notes, and snippets.

View noxecane's full-sized avatar
:shipit:
let's find out

Kunle Arewa noxecane

:shipit:
let's find out
View GitHub Profile
@noxecane
noxecane / keypath.es6
Last active November 28, 2015 23:17 — forked from anonymous/index.html
Data binding implementation in es6
export class KeyPath {
static lastValue(keypath, object) {
return keypath.split('.').reduce((prev, curr) => {
return prev && prev[curr];
}, data);
}
static lastKey(keypath, object) {
return keypath.split('.').pop();
}
@noxecane
noxecane / router.es6
Last active January 25, 2016 21:10 — forked from jbroadway/app.js
Simple History.js-based client-side router
'use strict';
import {Event} from './event.es6';
import * as func from './func.es6';
import * as classes from './classes.es6';
const paramReg = /:(\w+)/g;
const slashReg = /\//g;
const paramRepl = '(.*?)';
const slashRepl = '\\/';