Skip to content

Instantly share code, notes, and snippets.

Avatar
🤘
Design Systems 4 lyfe

Rob Phoenix robphoenix

🤘
Design Systems 4 lyfe
View GitHub Profile
View in-memory-data.service.ts
import { InMemoryDbService } from 'angular-in-memory-web-api'
import { Hero } from './hero'
export class InMemoryDataService implements InMemoryDbService {
createDb() {
const heroes = [
{ id: 11, name: 'Mr. Nice' },
{ id: 12, name: 'Narco' },
{ id: 13, name: 'Bombasto' },
{ id: 14, name: 'Celeritas' },
@robphoenix
robphoenix / flex.tsx
Created Dec 9, 2019
react flexbox component with as prop
View flex.tsx
/** @jsx jsx */
import { jsx } from '@emotion/core'
import React from 'react'
const Flex: React.FC<{
as?: React.ReactType
row?: boolean
column?: boolean
}> = ({ as: Component = `div`, row, column }) => {
const flexDirection = row ? 'row' : column ? 'column' : ''