strues / react-universal-boiler

A bold way to begin your next great universal React application. Uses Webpack 3, React 16, Redux, and more for a great developer experience.
MIT License
65 stars 11 forks source link

Allow to specify fetchData fn in the route object #26

Closed markudevelop closed 7 years ago

markudevelop commented 7 years ago

Like this:

{
    path: '/countries/:page?',
    exact: true,
    component: Countries,
    fetchData({ store, params }) {
      return store.dispatch(fetchContent(params.page || '1', 'countries'));
    },
  },

I had issues that too many HOC and static function was disappearing it couldn't find it. So I just added it here which is also nice.

codecov-io commented 7 years ago

Codecov Report

Merging #26 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #26   +/-   ##
=======================================
  Coverage   97.82%   97.82%           
=======================================
  Files          10       10           
  Lines          46       46           
  Branches        1        1           
=======================================
  Hits           45       45           
  Misses          1        1

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update da09cd7...6b72f5e. Read the comment docs.

strues commented 7 years ago

Excellent. Thank you. I've been busy this past week, but this looks great.