Skip to content

Instantly share code, notes, and snippets.

View jbyttow's full-sized avatar

Jason Byttow jbyttow

View GitHub Profile
@jbyttow
jbyttow / nion-normalized-state-tree.js
Created August 24, 2018 21:29
Nion Normalized State Tree Example
nion: {
entities: {
user: {
'3803025': {
attributes: {...},
relationships: {},
}
}
},
@jbyttow
jbyttow / nion-example.js
Last active August 28, 2018 20:43
Nion Example
import nion from 'nion'
@nion({
currentUser: {
endpoint: buildUrl('/api/current-user', { fields: user: ['avatarUrl'] }),
apiType: 'jsonApi'
}
})
class UserContainer extends Component {
render() {
@nion({
currentUser: {
endpoint: buildUrl('/api/current-user'),
apiType: 'jsonApi'
}
})
class UserContainer extends Component {
render() {
const { request, actions, data } = this.props.nion.currentUser
return (
import React, { Component } from 'react'
import styled from 'styled-components'
class VerifyPasswordComponent extends Component {
render() {
return <StyledVerifyPasswordComponent>Yo</StyledVerifyPasswordComponent>
}
}
const StyledVerifyPasswordComponent = styled.span`