This file contains 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 { builders as b } from 'ast-types' | |
export default ({ | |
name, | |
from, | |
}) => { | |
return b.variableDeclaration( | |
'const', | |
[ |
This file contains 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
[ | |
{ | |
"_id":"5bcaf86afb2028186d4af78b", | |
"name":"Person", | |
"__v":0, | |
"fields":[ | |
{ | |
"_id":"5bcaf88ffb2028186d4af78d", | |
"name":"dateOfBirth", | |
"__v":0, |
This file contains 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 populateRelated = (model, fieldList) => new Promise((resolve) => { | |
keystone.populateRelated(model, fieldList, () => { | |
resolve(model) | |
}) | |
}) | |
... |
This file contains 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
var keystone = require('keystone') | |
const who = [`updates`, `0.0.2-init`] | |
const items = { | |
CoreEntity: [ | |
{ | |
name: `Person` |
This file contains 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
var keystone = require('keystone') | |
var Types = keystone.Field.Types | |
var CoreField = new keystone.List('CoreField') | |
const typeList = [ | |
`Boolean`, | |
`String`, | |
`Date`, |
This file contains 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
var keystone = require('keystone') | |
var Types = keystone.Field.Types | |
var CoreEntity = new keystone.List('CoreEntity') | |
CoreEntity.add({ | |
name: { type: String, required: true, index: true, }, | |
}) |
This file contains 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' | |
function withWindowSize(WrappedComponent) { | |
return class WindowSizeProvider extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
innerWidth: 1280, | |
innerHeight: 800, |
This file contains 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, { PropTypes } from 'react' | |
const isDefined = (props, propName, componentName) => typeof props[propName] === 'undefined' && new Error('${ propName } undefined') | |
class YourComponent extends React.Component { | |
static propTypes = { | |
id: isDefined | |
} | |
render() { |
NewerOlder