This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
// TODO : Remove dependency on lodash | |
import _ from 'lodash'; | |
// const r = objectDifference( | |
// { | |
// one: 'two', | |
// three: 'five', | |
// five: ['six', { seven: 'eight' }], | |
// six: ['seven', { seven: 'eight' }], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ? 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
/* | |
Called to build our states schema. | |
*/ | |
const $ = StateManager({ | |
/* `config` to configure globally - passed to all state modules */ | |
config: {}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |