This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import personService from 'services/person'; | |
import uuid from 'node-uuid'; | |
const defaultState = { | |
persons: [], | |
}; | |
export function getPersons() { | |
return { | |
type: 'PERSON_GET_PERSONS', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Router } from 'react-router-dom'; | |
import createBrowserHistory from 'history/createBrowserHistory'; | |
const LOCATION_CHANGE = '@@router/LOCATION_CHANGE'; | |
export const history = createBrowserHistory(); | |
class ReduxRouter extends React.Component { | |
static propTypes = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
plugins: { | |
precss: {}, | |
autoprefixer: { | |
browsers: ['last 2 versions'], | |
}, | |
}, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import personService from "../services/person"; | |
import { Form, Field } from "react-final-form"; | |
import { DateTime } from "luxon"; | |
const required = value => (value ? undefined : "Required"); | |
const mustBeDate = value => { | |
const dt = DateTime.fromISO(value); | |
return dt.invalid && "Must be a date"; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import schema from "./schema"; | |
import { graphqlExpress, graphiqlExpress } from "apollo-server-express"; | |
app.use( | |
"/graphql", | |
graphqlExpress(req => { | |
return { | |
schema | |
}; | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import personService from "../services/person"; | |
import { Form, Field } from "react-final-form"; | |
import { DateTime } from "luxon"; | |
const required = value => (value ? undefined : "Required"); | |
const mustBeDate = value => { | |
const dt = DateTime.fromISO(value); | |
return dt.invalid && "Must be a date"; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this one goes to the personService--createPerson | |
get age() { | |
const d = DateTime.fromJSDate(this.birthDay); | |
const now = DateTime.local(); | |
var diff = now.diff(d, "years").toObject(); | |
return diff.years; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Map } = require("immutable"); | |
function getEnvironmentVariables() { | |
return Map(process.env) | |
.filter((v, k) => k === "NODE_ENV" || k.startsWith("REACT_APP_")) | |
.map((v, k) => JSON.stringify(v)) | |
.toJS(); | |
} | |
module.exports = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myFeature = require("./src/config/workboxFeature"); | |
addFeatures( | |
..., | |
myFeature, | |
) |