Comments (3)
hey @bestguy, I've never used mobX to be honest, but for that purpose I suppose you can make a computed property in the mapToProps function passed to the connect
HOC, like so:
const mapToProps = (state) => ({ name: state.firstName + " " + state.lastName })
const Comp = connect(mapToProps)(({ firstName }) => <span>hello {firstName}!</span>)
It would probably make sense to implement some kind of caching if you want to use this more extensively though.
from redux-zero.
Hi @bestguy
Are you ok with @malbernaz 's answer? Do you still have a doubt about computed values?
from redux-zero.
Yes thanks, I'm fine closing. Answer is not exactly what I'd "like" in that the derived data is then defined in the component vs store, but this helps, thanks.
from redux-zero.
Related Issues (20)
- redux devtools dispatch not working HOT 2
- Adding redux-devtools options parameters HOT 1
- Writing typesafe actions HOT 1
- Unit mapToProps? (pass through) HOT 1
- Release seems to be missing types/Actions.ts HOT 5
- Use via script tags? HOT 1
- react waning for <Connect> HOT 11
- Not able to use redux-zero through UMD HOT 1
- Action type doesn't support Promise as return type HOT 1
- RFC - Remove all current binding functions except for Hooks HOT 10
- Add useActions hook for react HOT 2
- Update connect/Connect to use hooks instead of classes
- How to ensure the sequence of the async actions? HOT 2
- where is getActions exported from? HOT 1
- Proper syntax for store.setState callback?
- Docs website down?
- The latest published `types/Actions.d.ts` is not same as `types/index.d.ts` . HOT 2
- value from props is not passing
- use redux-zero in typescript HOT 1
- Can't test redux-zero with JEST and TypeScript? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-zero.