Hacker News new | past | comments | ask | show | jobs | submit login

Does anyone know if you can do this in reactjs? It would be awesome to build a excel like spreadsheet with user-input formulas.



Check out MobX, as it comes with React bindings to re-render components when their reactive dependencies change: https://github.com/mobxjs/mobx


There is Baobab[1] - it is a single state-tree approach, while supporting computed values in the tree and has a react adapter[2].

[1]: https://github.com/Yomguithereal/baobab#computed-data-or-mon...

[2]: https://github.com/Yomguithereal/baobab-react



As another poster said, you can use Meteor's Tracker and ReactiveVar modules to do it. Here's a standalone package that doesn't require the Meteor platform: https://www.npmjs.com/package/meteor-standalone-tracker


Wouldn't it be backwards to do this in React? Everything is controlled by a state object you manually set, so you already know when values are going to change.


actually - I'm talking about a function expression. Think about a spreadsheet with a formula similar to "=SUM(A1+B1)". What this means is that when A1 or B1 change.. then this formula result should get re-computed. Remember that A1 and B1 themselves may be computed results...

what happens today is that I need to recompute ALL formulas - because there is no easy way to know which formulas changed.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: