salsita / prism

React / Redux action composition made simple http://salsita.github.io/prism/
496 stars 24 forks source link

Purpose of view wrapper? #52

Closed dalgard closed 7 years ago

dalgard commented 7 years ago

Does wrapping my component with view() to create a higher-order component serve any purpose in regard to composition/Elm architecture?

It looks like what it mainly does is dispatching mount/unmount actions and optimizing certain things, which are not essentially related to the fractal pattern.

tomkis commented 7 years ago

It looks like what it mainly does is dispatching mount/unmount actions and optimizing certain things, which are not essentially related to the fractal pattern.

You are absolutely right, it's there so that we can instantiate/deinstatiate fractal Sagas.

dalgard commented 7 years ago

How does that work, exactly?

I'm in the process of employing redux-elm in an enterprise front-end architecture, and it is important for me to understand the role of each piece.

krzysztofpniak commented 7 years ago

@dalgard the code is really short (~60LOC): https://github.com/salsita/redux-elm/blob/master/src/view.js