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
// ? 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
// 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
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
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
/* @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
/** | |
* SetMap provides an extended Map which mixes in some extra commands. The idea is | |
* to use this when you need to manage a Map of Sets or Maps. It provides various | |
* prototype methods that make it easy to build these data structures. | |
* | |
* Map<any, Set<any> | Map<any, any> | any> | |
* @extends {Map} | |
*/ | |
export default class SetMap extends Map { | |
add(key, ...values) { |
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
// Any quick tests that we want to run `yarn try` | |
import { performance } from 'perf_hooks'; | |
import createState from './src/index'; | |
const state = createState({ | |
config: { mid: 'my-module' }, | |
// Hooks allow simple hooking into the lifecycle of the state | |
hooks: { | |
// Before action is dispatched, may return an action with new properties | |
before: [action => console.group('DISPATCHING: ', action)], |
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, select, fork } from 'redux-saga/effects'; | |
import { createTaskManager } from 'saga-task-manager'; | |
import appConfig from 'utils/config'; | |
import processLoadsWithScope from './config/processLoadsWithScope'; | |
import processReducer from './config/processReducer'; | |
import processSelectors from './config/processSelectors'; |
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 { getDashboardWidgetSchema } from './utils/widgetSchema' | |
const getWidgetDefaultSchema = widgetName => { | |
const schema = getDashboardWidgetSchema(widgetName) | |
if ( ! schema ) { | |
throw new Error(`[Grid]: Widget Not Known: ${widgetName}`) | |
} | |
return schema | |
} |