Computed runtime arguments not working
See original GitHub issueI have a computed defined like this…
getBase64Video: computed([state => state.video], video => {
return botid => {
try {
let b64 = btoa(video[botid].image);
return `data:image/jpeg;base64,${b64}`;
} catch (e) {
console.log(e);
}
};
})
And I get the error hooks.js:42 Uncaught Error: An error occurred trying to map state in a useStoreState hook: state.bots.getBase64Video is not a function. when I try calling it with let video = useStoreState(state => state.bots.getBase64Video(props.botid));
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Can I pass parameters in computed properties in Vue.Js
Should I be using methods for such cases? No, you can't pass parameters to computed properties. Yes, using methods is the easiest way...
Read more >Cache system for getters with arguments #777 - vuejs/vuex
When I do this with one getter function to which I feed the item ID as argument, the vue caching does not work,...
Read more >Pass runtime arguments in an execution request | Workflows
You can pass runtime arguments in a workflow execution request and access those arguments using workflow variables.
Read more >Computeds with arguments · MobX
1. Derivations don't need to be computed ... A function doesn't need to be marked as computed in order for MobX to track...
Read more >Main() and command-line arguments | Microsoft Learn
If no arguments are supplied, the application issues a message that explains the correct usage of the program. To compile and run the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@pranaypratyush Actually i had the exact same issue before with both
redux-persistandcomputedfields in which i did the same approach of usingredux-persist-transform-filterat the endHowever after installing the latest version 3.0.1 and tried adding a computed field to the white list, it’s working properly now.
Here’s my config inside the
createStore()functionisLoggedInis the computed field and is being persisted and re-hydrated properly now.The problem is specifically that if a
computedreturns a function then redux-persist with cause problems with it. I usedredux-persist-transform-filterto filter it out and there are no problems now. In fact, I would want a way forredux-persistto ignore all computed fields.