GithubHelp home page GithubHelp logo

Comments (6)

neerajwahi avatar neerajwahi commented on September 24, 2024

@borisyankov why add container components?

from zulip-mobile.

borisyankov avatar borisyankov commented on September 24, 2024

Mostly for separation of concerns. Sometimes for better reusability, but not always.
I've also used before it to convert from Immutable to plain JS objects, but not sure it was consistently a good idea.

Generally a container will take care of retrieving the data (from Redux, via fetch, etc.) but will just render a single component. The behavior and view will be in this component, but it will be 'dumb' about where the data is coming from.

Some of the ideas come from:
https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0#.fakt3m8o4
and some from other discussion places and personal experience.

from zulip-mobile.

neerajwahi avatar neerajwahi commented on September 24, 2024

I think we can wait to do this kind of refactoring until it becomes a bigger problem. Thoughts?

from zulip-mobile.

neerajwahi avatar neerajwahi commented on September 24, 2024

Also, I'm not sure it's worthwhile to add Flow types to the API calls. Flow is a static type checker but the API results are dynamic, so it won't really be able to do any checking with those types.

from zulip-mobile.

borisyankov avatar borisyankov commented on September 24, 2024

@neerajwahi Yeah, I wanted to document the goals more than necessarily put it as priority.
New stuff will follow this, but not going to rework everything that was written (did the Zulip removing because it was trivial)

from zulip-mobile.

borisyankov avatar borisyankov commented on September 24, 2024

Closing as 'complete'.

from zulip-mobile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.