Skip to content

Instantly share code, notes, and snippets.

View LeighCiechanowski's full-sized avatar

Leigh Ciechanowski LeighCiechanowski

View GitHub Profile
@LeighCiechanowski
LeighCiechanowski / example-test-child-props.jsx
Created November 3, 2022 11:40
Example Testing Child Props are Passed
import React from "react";
import ChildComponent from "./ChildComponent";
const ParentComponent = ({ open, data }) => (
<>
<p>Some content to render</p>
{open && <ChildComponent open={open} data={data} />}
</>
);
@LeighCiechanowski
LeighCiechanowski / filter-map-reduce.js
Created October 12, 2018 08:29
Filter Map Reduce
const data = [
{
name: 'Butters',
age: 3,
type: 'dog'
},
{
name: 'Lizzy',
age: 6,
type: 'dog'
@LeighCiechanowski
LeighCiechanowski / mongoClient.js
Created March 23, 2018 14:23
Singleton MongoDB Client
import { MongoClient } from 'mongodb';
const DbConnection = function () {
var db = null;
var instance = 0;
async function DbConnect() {
try {
let url = 'mongodb://localhost:27017/articles';