Skip to content

Instantly share code, notes, and snippets.

View Tauka's full-sized avatar
🎯
Focusing

Tauyekel Kunzhol Tauka

🎯
Focusing
  • Nazarbayev University
  • Astana, Kazakhstan
View GitHub Profile
const MIN_BASE = 10;
const LIMIT = .7;
const GROW_SCALE = 2;
class HashMap
{
constructor(base = MIN_BASE)
{
Object.assign(this, this._genNew(base));
}
function Mutilator(data, name, context) {
this.n = name || `mutilation-${+new Date()}`;
this.d = data;
this.c = context || window;
this.isArr = function(p) {
return this.d[p].constructor == Array;
};
this.dispatch = function(p, v, t) {
this.c.dispatchEvent(
new CustomEvent(this.n, {
@Tauka
Tauka / basket.js
Created February 9, 2018 12:18 — forked from kana-sama/basket.js
products-basket-selectors-example
// fake reselect
const createSelector = (deps, body) => (state, props) =>
body(...deps.map(dep => dep(state, props)));
const createStructuredSelector = scheme => (state, props) =>
Object.keys(scheme).reduce((result, key) => ({
...result,
[key]: scheme[key](state, props)
}), {});