Skip to content

Instantly share code, notes, and snippets.

View phd20's full-sized avatar

Kirk Wiebe phd20

View GitHub Profile
@phd20
phd20 / gist:f6ec5674b5442f0bb77de2d135043bb4
Created July 8, 2023 12:31
Quick Dungeon Map Prep in Obsidian
```leaflet
id: trial-slime-lord
image: [[trialoftheslimelord_-_dm.png]]
height: 900px
width: 95%
minZoom:5
maxZoom: 10
zoomDelta: .5
defaultZoom: 7
scale: 12
@phd20
phd20 / index.tsx
Created March 22, 2019 01:08
Working version of container that returns array of objects
import { connect } from "react-redux";
import Dashboard from "./dashboard";
import { ApplicationState } from "../../store";
const mapStateToProps = (state: ApplicationState) => {
return {
user: state.oidc.user,
sessions: Object.values(state.sessions.sessions),
};
};
@phd20
phd20 / index.tsx
Created March 22, 2019 01:06
Container for main component
import { connect } from "react-redux";
import Dashboard from "./dashboard";
import { ApplicationState } from "../../store";
import { sessionsArraySelector } from "../../store/selectors/sessions";
const mapStateToProps = (state: ApplicationState) => {
return {
user: state.oidc.user,
sessions: sessionsArraySelector(state),
};
@phd20
phd20 / sessions.ts
Created March 22, 2019 01:05
Selectors using reselect
import { createSelector } from 'reselect';
import { ApplicationState } from "..";
const sessionsSelector = (state: ApplicationState) => state.sessions.sessions;
export const sessionsArraySelector = createSelector(
sessionsSelector,
(sessions) => Object.values(sessions)
);