ctrlplusb / react-jobs

Asynchronously resolve data for your components, with support for server side rendering.
MIT License
166 stars 34 forks source link

SSR: state set explicitly but rehydrated implicitly #17

Closed djgrant closed 7 years ago

djgrant commented 7 years ago

runJobs requires the developer to explicitly pass the state in a script tag. rehydrateJobs gets the state itself. It has an implicit dependency on the global state created by the developer.

Could runJobs create the script tag itself?

For transparency sake it seems better if either both functions do magic to pass the state between server and client, or that the handover of state is explicit at both ends.

ctrlplusb commented 7 years ago

New API is much more explicit. 😀