Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Dhanaraj chrisdhanaraj

View GitHub Profile
@chrisdhanaraj
chrisdhanaraj / statechart.md
Last active Jul 1, 2021
Figuring out the state chart
View statechart.md

When I press (Add Window)

  • Always blank!

When I press (Edit Window)

  • When I press edit window

--- If I've selected a mID - Find window id's, if all match, show those - Find window id's, if not all match, show blank

View Rollup.md

interface RolledUpWindow { ... propertiesofAWindow associatedWindowIds: [--> viewableIds] }

{ rgts_searchDealWindow: { dealEntries: { ... on Show {

@chrisdhanaraj
chrisdhanaraj / filterbar.md
Last active May 24, 2021
Descrbing the filter bar
View filterbar.md

Filter Bar

Allow a user to type to either

A) Filter available keys by name B) Filter available keys by validation C) Filter available values for defined lists

@chrisdhanaraj
chrisdhanaraj / useSearch.tsx
Last active Feb 17, 2020
Use Redicer with Side Effects example
View useSearch.tsx
import useReducerWithSideEffects, {
NoUpdate,
Update,
UpdateWithSideEffect,
Reducer,
ReducerReturn
} from 'use-reducer-with-side-effects';
import { useCallback, useEffect, useContext } from 'react';
const initialStateArgs = {
View gist:0a1d02c2d6b4ba28c1275f639065df01
interface Query {
queryString: string,
variables: {
[key]: string;
}
}
function convertToQuery({
query,
queries,
View use-reducer-with-side-effects.d.ts
// Type definitions for use-reducer-with-side-effects 0.4
// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)
// Definitions by: Chris Dhanaraj <https://github.com/chrisdhanaraj>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/*~ If this module has methods, declare them as functions like so.
*/
type SideEffectArguments = {
state: any;
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions