Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can forwarding be referentially transparent? #95

Open
ccorcos opened this issue Feb 25, 2016 · 2 comments
Open

How can forwarding be referentially transparent? #95

ccorcos opened this issue Feb 25, 2016 · 2 comments

Comments

@ccorcos
Copy link
Contributor

ccorcos commented Feb 25, 2016

The issue I'm trying to solve is tying to make this listOf function more performant:

https://github.com/paldepind/functional-frontend-architecture/blob/master/examples/nesting/js/list.js#L38

We can use thunks and stuff to lazily evaluate the UI. But the action$ is going to have a new reference every time so lazily evaluating with the listOf component is helpless. However, what if there was some way of computing stream.eq(prevAction$, nextAction$)? We could feasibly do this by keeping track of the forwarding going on.

Maybe I'm barking up the wrong tree, but its frustrating that this list componnt is going to cause all items to rerender regardless.

@c-dante
Copy link
Contributor

c-dante commented Mar 4, 2016

If I'm understanding this correctly, the issue is that your update function is just re-generate the entire list on each action, regardless of if it actually changed anything. Is that correct?

@ccorcos
Copy link
Contributor Author

ccorcos commented Mar 4, 2016

Yes. Well mostly. The thing is the function reference changed, but its still the same stream and the same forwarding. So its effectively equal even though it isnt referentially equal. Here's an example of what I'm thinking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants