Skip to content

Instantly share code, notes, and snippets.

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"
// ? 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();
// 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;
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: {
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);
/* @flow */
// TODO : Remove dependency on lodash
import _ from 'lodash';
// const r = objectDifference(
// {
// one: 'two',
// three: 'five',
// five: ['six', { seven: 'eight' }],
// six: ['seven', { seven: 'eight' }],
/**
* 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) {
// 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)],
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';
import { getDashboardWidgetSchema } from './utils/widgetSchema'
const getWidgetDefaultSchema = widgetName => {
const schema = getDashboardWidgetSchema(widgetName)
if ( ! schema ) {
throw new Error(`[Grid]: Widget Not Known: ${widgetName}`)
}
return schema
}