Skip to content

Commit 3626e33

Browse files
author
Andrew Ross
committed
Changed examples
1 parent b72f4e2 commit 3626e33

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

examples/auth-flow.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const App = React.createClass({
3838
}
3939
},
4040

41-
updateAuth(loggedIn) {
41+
updateAuth(loggedIn:any) {
4242
this.setState({
4343
loggedIn: loggedIn
4444
})
@@ -101,7 +101,7 @@ const Login = React.createClass({
101101
const email = this.refs.email.value
102102
const pass = this.refs.pass.value
103103

104-
auth.login(email, pass, (loggedIn) => {
104+
auth.login(email, pass, (loggedIn:any) => {
105105
if (!loggedIn)
106106
return this.setState({ error: true })
107107

@@ -145,7 +145,7 @@ const Logout = React.createClass({
145145
}
146146
})
147147

148-
function requireAuth(nextState, replace) {
148+
function requireAuth(nextState:any, replace:any) {
149149
if (!auth.loggedIn()) {
150150
replace({
151151
pathname: '/login',

examples/auth.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export = {
2-
login(email?, pass?, cb?) {
2+
login(email?:any, pass?:any, cb?:any) {
33
cb = arguments[arguments.length - 1]
44
if (localStorage['token']) {
55
if (cb) cb(true);
66
this.onChange(true)
77
return
88
}
9-
pretendRequest(email, pass, (res) => {
9+
pretendRequest(email, pass, (res:any) => {
1010
if (res.authenticated) {
1111
localStorage['token'] = res.token
1212
if (cb) cb(true)
@@ -22,7 +22,7 @@ export = {
2222
return localStorage['token']
2323
},
2424

25-
logout(cb?) {
25+
logout(cb?:any) {
2626
delete localStorage['token']
2727
if (cb) cb()
2828
this.onChange(false)
@@ -35,7 +35,7 @@ export = {
3535
onChange() {}
3636
}
3737

38-
function pretendRequest(email, pass, cb) {
38+
function pretendRequest(email:any, pass:any, cb:any) {
3939
setTimeout(() => {
4040
if (email === '[email protected]' && pass === 'password1') {
4141
cb({

examples/breadcrumbs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class App extends React.Component<IInjectedProps, any> {
6666
class Products extends React.Component<{}, {}> {
6767

6868
static title = 'Products'
69-
path = '/products'
69+
static path = '/products'
7070

7171
render() {
7272
return (

examples/confirmation-navigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ const Form = React.createClass({
7373
return 'You have unsaved information, are you sure you want to leave this page?'
7474
},
7575

76-
handleChange(event) {
76+
handleChange(event:any) {
7777
this.setState({
7878
textValue: event.target.value
7979
})
8080
},
8181

82-
handleSubmit(event) {
82+
handleSubmit(event:any) {
8383
event.preventDefault()
8484

8585
this.setState({

0 commit comments

Comments
 (0)