HackerTrans
TopNewTrendsCommentsPastAskShowJobs

cel1ne

no profile record

comments

cel1ne
·9 वर्ष पहले·discuss
I have a network-state in every application, usually as a set of "NetworkRequests", which are data-object that describe a request. Just like I sync the UI-state to the browser using React, I sync the network-state to the network by

a) using a custom NetworkManager, that takes a set of requests and syncs it with currently running requests.

b) using react itself. In a simple project I created a ReactComponent for every network-request. The render() is just an invisible div, the actual requests get started and stopped in componentDidMount() and other life-cycle hooks.

This approach works everywhere, it is serialisable and easy to think about.

I tend to write the redux-part ("controller") of my applications myself, it's seldomly more than 100 lines and more adaptable to my needs.

And I never use immutable.js, it's really unnecessary and slows down development-speed (via it's weird api) and runtime-performance.