Computed properties with a runtime argument missing when used with persistence?
See original GitHub issueWith persistence turned on our app throws Error in useStoreState: state.assets.getStakedAssetsByAddress is not a function..
It is a computed property with a runtime argument.
getStakedAssetsByAddress: computed(
(state) => (address) => Object.values(state.stakedAssetsById[address]) || []
),
This exact issue was tackled in v4. https://github.com/ctrlplusb/easy-peasy/issues/503 Could there be a regression in v5?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Bountysource
Computed properties with a runtime argument missing when used with persistence ?
Read more >computed property set not called in Vue - Stack Overflow
The problem happens because your computed property returns an object defined nowhere but in the get handler. Whatever you try, you won't be...
Read more >Computed properties: What am I missing? - General - Ember.JS
Hi,. The behavior of ember computed properties always suprises me and I would like to have a better understand of it. (I am...
Read more >computed | Easy Peasy v5
Computed properties do not natively support runtime arguments, however, you can achieve this by resolving a function from your computed property ...
Read more >Defining and Using Literal Properties
Specifically, an error occurs if the value is missing when you attempt to insert or update a record. Defining a Computed Property. In...
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

Thanks for taking the time to put this together for me.
OK. I’m back with the example @ctrlplusb.
Here’s the snack. easy-peasy-persist-computed-bug
I set the store up the same way we do our production app. You will notice we build a pretty complex import structure for the store, but it’s easier to manage in the long run.
state.thing1.getAllTheThings is not a function.state.thing1.getAllTheThings is not a function.And if you’re wondering why I’m not using Easy Peasy’s persistence. 👉 https://github.com/ctrlplusb/easy-peasy/issues/672 Maybe related?