Skip to content

Instantly share code, notes, and snippets.

/* @flow */
// TODO : Remove dependency on lodash
import _ from 'lodash';
// const r = objectDifference(
// {
// one: 'two',
// three: 'five',
// five: ['six', { seven: 'eight' }],
// six: ['seven', { seven: 'eight' }],
import { PROXY_SYMBOL } from './src2/context';
const rootDescriptor = { changed: new Map(), path: [] };
const ProxyDescriptors = new WeakMap();
const proxyTraps = {
get(target, prop, receiver) {
if (prop === PROXY_SYMBOL) return target[prop];
if (typeof prop === 'symbol') return Reflect.get(target, prop, receiver);
import createState from './src/libraries/state-modules/core';
/*
Called to build our states schema.
*/
const $ = createState({
/* `config` to configure globally - passed to all state modules */
config: {},
/* Hooks are middleware that are called at specific parts of the lifecycle and allow modifying behavior */
hooks: {
// TODO: Remove lodash as dependency
import _ from 'lodash';
import toSnakeCase from 'to-redux-type';
import { MODULE_NAME, SAGA_LIFECYCLES } from './context';
function handleBoundAction(dispatch, pid, type, args, action, ...fnargs) {
const createdAction = { type, ...action };
fnargs.forEach((arg, idx) => {
if (idx < args.length) {
createdAction[args[idx]] = arg;
// ? Consider implementing lightweight replacement of immer?
import produce from 'immer';
import handleNewStateModule from './build';
import { MODULE_NAME } from './context';
import diff from './diff';
import connectState from './connect';
// Used for storing the private methods and properties of each manager
const ManagerPrivateState = new WeakMap();
namespace eval DAAP {
variable groups "cmst mlog agal mlcl mshl mlit abro abar \
apso caci avdb cmcp cmgt aply adbs cmpa \
mdcl msrv merr mccr mupd agar aply msml \
casp agal"
variable containers "cmcp cmst msrv mlog avdb aply msml casp
mccr agar agal"
variable asciiCodes "cann cang minm cana canl mcmn"
async function Event(req, res, data, callback) {
if (data.query.block) {
const prefix = data.query.block.split('_')[0];
// If the parameter passed in starts with xrb_ or nano_, send them to an account search
if (prefix === 'xrb' || prefix === 'nano') {
res.writeHead(302, { Location: `/${data.params.lang}/explore/account/${data.query.block}` });
} else {
res.writeHead(302, { Location: `/${data.params.lang}/explore/block/${data.query.block}` });
}
return res.end();
import * as React from 'react';
/*
Called to build our states schema.
*/
const $ = StateManager({
/* `config` to configure globally - passed to all state modules */
config: {},
import { Process } from 'redux-saga-process';
import { call, put } from 'redux-saga/effects';
import { createSelector } from 'reselect';
import { createTaskManager } from 'saga-task-manager';
import startUserPositionObserver from 'saga-geolocation-observer';
import handleUserPosition from './sagas/handleUserPosition';
/*
A Process allows us to define a modular "Logic Component" which may
interact with our app in a variety of ways based on it's design.
Processes are given properties when configured which will define if/how
they reduce the redux state, what actions they make available to our
components, when our process should load and with what scope,
what types we want to listen for, and more.
This allows us to build truly encapsulated and re-useable application