File tree 5 files changed +10
-10
lines changed
5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ export function increment() {
7
7
}
8
8
9
9
export function incrementIfOdd ( ) {
10
- return ( dispatch , atom ) => {
11
- if ( atom . counter % 2 === 0 ) {
10
+ return ( dispatch , { counter } ) => {
11
+ if ( counter % 2 === 0 ) {
12
12
return ;
13
13
}
14
14
Original file line number Diff line number Diff line change 1
- import React , { Component } from 'react' ;
1
+ import React from 'react' ;
2
2
import { Injector } from 'redux' ;
3
3
import Counter from '../components/Counter' ;
4
4
import * as CounterActions from '../actions/CounterActions' ;
@@ -7,7 +7,7 @@ export default class CounterApp {
7
7
render ( ) {
8
8
return (
9
9
< Injector actions = { CounterActions } >
10
- { ( { atom : { counter } , actions } ) =>
10
+ { ( { state : { counter } , actions } ) =>
11
11
< Counter counter = { counter } { ...actions } />
12
12
}
13
13
</ Injector >
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export default class TodoApp {
8
8
render ( ) {
9
9
return (
10
10
< Injector actions = { TodoActions } >
11
- { ( { atom : { todos } , actions} ) =>
11
+ { ( { state : { todos } , actions} ) =>
12
12
< div >
13
13
< AddTodo { ...actions } />
14
14
< TodoList todos = { todos } { ...actions } />
Original file line number Diff line number Diff line change @@ -53,6 +53,6 @@ export default class Injector extends Component {
53
53
this . performAction . bind ( this , actionCreator )
54
54
) ;
55
55
56
- return children ( { atom, actions } ) ;
56
+ return children ( { state : atom , actions } ) ;
57
57
}
58
58
}
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import React from 'react';
2
2
import Injector from '../Injector' ;
3
3
import getDisplayName from '../utils/getDisplayName' ;
4
4
5
- function mergeAll ( { props, atom , actions } ) {
6
- return { ...props , ...atom , ...actions } ;
5
+ function mergeAll ( { props, state , actions } ) {
6
+ return { ...props , ...state , ...actions } ;
7
7
}
8
8
9
9
export default function inject (
@@ -25,9 +25,9 @@ export default function inject(
25
25
) ;
26
26
}
27
27
28
- renderChild ( { atom , actions } ) {
28
+ renderChild ( { state , actions } ) {
29
29
const { props } = this ;
30
- const childProps = getChildProps ( { props, atom , actions } ) ;
30
+ const childProps = getChildProps ( { props, state , actions } ) ;
31
31
32
32
return < DecoratedComponent { ...childProps } /> ;
33
33
}
You can’t perform that action at this time.
0 commit comments