Skip to content

Instantly share code, notes, and snippets.

View chrisdhanaraj's full-sized avatar

Chris Dhanaraj chrisdhanaraj

View GitHub Profile
@chrisdhanaraj
chrisdhanaraj / example.tsx
Created September 21, 2022 17:02
Example
const TableWrapper = ({
someProperty,
otherProperty
}) => {
const [data, loading] = useQuery({
variables: {
someProperty,
otherProperty
}
});
@chrisdhanaraj
chrisdhanaraj / statechart.md
Last active July 1, 2021 03:05
Figuring out the state chart

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

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

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

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

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 February 17, 2020 23:28
Use Redicer with Side Effects example
import useReducerWithSideEffects, {
NoUpdate,
Update,
UpdateWithSideEffect,
Reducer,
ReducerReturn
} from 'use-reducer-with-side-effects';
import { useCallback, useEffect, useContext } from 'react';
const initialStateArgs = {
interface Query {
queryString: string,
variables: {
[key]: string;
}
}
function convertToQuery({
query,
queries,
// 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;
@chrisdhanaraj
chrisdhanaraj / machine.js
Last active July 16, 2019 21:35
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions