Skip to content

Instantly share code, notes, and snippets.

View doug2k1's full-sized avatar

Douglas Matoso doug2k1

  • Campinas - SP - Brazil
View GitHub Profile
const { graphqlExpress } = require('apollo-server-express');
const { makeExecutableSchema } = require('graphql-tools');
const { importSchema } = require('graphql-import');
const resolvers = require('./graphql/resolvers');
const setup = app => {
const schema = makeExecutableSchema({
typeDefs: importSchema('src/graphql/schema.graphql'),
resolvers
});
@doug2k1
doug2k1 / component.js
Created March 12, 2019 18:58
React detect changed props
componentDidUpdate(prevProps: Props) {
console.log('UPDATE');
Object.keys(this.props)
.filter(key => this.props[key] !== prevProps[key])
.map(key => {
console.log(
'changed property:',
key,
'from',
prevProps[key],
@doug2k1
doug2k1 / config-template.json
Created May 7, 2020 19:17
Create JSON from template
{
"name": "Test",
"baseURL": "__baseURL__",
"otherBaseURL": "__baseURL__"
}
@doug2k1
doug2k1 / learn-frontend-react-typescript.md
Last active November 17, 2022 01:34
Frontend, React, TypeScript Roadmap

Frontend, React, TypeScript Roadmap

Tips:

  • Read the introduction for each topic and dive deep only when needed
  • Official documentation is, most of the time, the best source

Foundation