besarthoxhaj / phoenix

React native project example
9 stars 1 forks source link

Slight shorter wording option? #34

Closed izaakrogan closed 8 years ago

izaakrogan commented 8 years ago

export const reducer = thereducer export default = thereducer .... import { reducer as navigation } from './navigation.js'; import navigation from './navigation.js'

I'm guessing the initial state is being exported for tests? The reducer is indeed the reducer so can be exported as the default and have initial state as an extra property on the export. Just like: import React, {View} from 'react-native'

besarthoxhaj commented 8 years ago

@izaakrogan

I'm guessing the initial state is being exported for tests?

Yes!

Just like: import React, {View} from 'react-native'

Like it! Use default for the reducer and all the rest as extra property.