Skip to content

Commit

Permalink
Update ESlint.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Apr 28, 2018
1 parent 2c4d1ee commit 24ce03f
Show file tree
Hide file tree
Showing 8 changed files with 316 additions and 67 deletions.
6 changes: 3 additions & 3 deletions demo/components/App.js
Expand Up @@ -7,13 +7,13 @@ import Nav from './Nav'
import PersonalInfo from './PersonalInfo'
import Footer from './Footer'

import type { session } from '../../src/session'
import type { Session } from '../../src/session'
import { popupLogin, logout, currentSession } from '../../src/'

export default class App extends React.Component<Object, Object> {
state: { session: ?session } = { session: null }
state: { session: ?Session } = { session: null }

saveCredentials = (session: session): void => {
saveCredentials = (session: Session): void => {
this.setState({ session })
}

Expand Down
14 changes: 7 additions & 7 deletions demo/components/PersonalInfo.js
Expand Up @@ -3,24 +3,24 @@ import 'isomorphic-fetch'
import React from 'react'

import { fetch } from '../../src/'
import type { session } from '../../src/session'
import type { Session } from '../../src/session'

type profile = {
type Profile = {
'foaf:name': ?{ '@value': string }
}

export default class PersonalInfo extends React.Component<Object, Object> {
props: { session: ?session }
props: { session: ?Session }

defaultProps = {
session: null
}

state: { profile: profile } = {
state: { profile: Profile } = {
profile: { 'foaf:name': null }
}

fetchProfile = (webId: string): Promise<profile> => {
fetchProfile = (webId: string): Promise<Profile> => {
const query = `
@prefix foaf http://xmlns.com/foaf/0.1/
${webId} { foaf:name }
Expand All @@ -31,9 +31,9 @@ export default class PersonalInfo extends React.Component<Object, Object> {
}).then(resp => resp.json())
}

saveProfile = (profile: profile): void => this.setState({ profile })
saveProfile = (profile: Profile): void => this.setState({ profile })

componentWillReceiveProps(props: { session: ?session }) {
componentWillReceiveProps(props: { session: ?Session }) {
if (props.session) {
this.fetchProfile(props.session.webId).then(this.saveProfile)
}
Expand Down

0 comments on commit 24ce03f

Please sign in to comment.