Skip to content

Commit

Permalink
use desctructing and assignment to rename instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Jul 25, 2015
1 parent a1a4ac8 commit 81b1c81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions common/app/routes/Hikes/flux/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ export default Actions({
setHikes: null
})
.refs({ displayName: 'HikesActions' })
.init(({ instance, args: [services] }) => {
.init(({ instance: hikeActions, args: [services] }) => {
// set up hikes fetching
instance.fetchHikes.subscribe(
hikeActions.fetchHikes.subscribe(
({ isPrimed, dashedName }) => {
if (isPrimed) {
return instance.setHikes({
return hikeActions.setHikes({
transform: (oldState) => {
const { hikes } = oldState;
const currentHike = getCurrentHike(
Expand All @@ -53,7 +53,7 @@ export default Actions({
if (err) {
debug('an error occurred fetching hikes', err);
}
instance.setHikes({
hikeActions.setHikes({
set: {
hikes: hikes,
currentHike: getCurrentHike(hikes, dashedName)
Expand Down
7 changes: 3 additions & 4 deletions common/app/routes/Hikes/flux/Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ const initialValue = {

export default Store(initialValue)
.refs({ displayName: 'HikesStore'})
.init(({ instance, args }) => {
const [cat] = args;
.init(({ instance: hikeStore, args: [cat] }) => {

let { setHikes } = cat.getActions('hikesActions');
instance.register(setHikes);
hikeStore.register(setHikes);

return instance;
return hikeStore;
});

0 comments on commit 81b1c81

Please sign in to comment.