FormidableLabs / freactal

Clean and robust state management for React and React-like libs.
MIT License
1.65k stars 47 forks source link

passes props to initialize effect #71

Closed Jascha-Sundaresan closed 6 years ago

Jascha-Sundaresan commented 6 years ago

Initialize w/o props is cripplingly difficult to use.

Passing in props by default allows for loading resources based on a router match:

initialize: (effects, props) ->
      Api.find('user', props.match.params.userName)
      .then (result) -> mergeIntoState user: Immutable.fromJS(result)
Jascha-Sundaresan commented 6 years ago

Awesome! thanks!