Comments (3)
I don't know much about ember-orbit, can you tell me more about your intended use case?
from react-orbitjs.
I don't know much about ember-orbit, can you tell me more about your intended use case?
Sure:
I got a component that uses withData
and among other things it retrieves multiple instances of the model (let's say) user
, the user
model defines a hasOne
relationship with the model (let's say) BestFriend
I generate a table of user where I want to print every retrieved User
and in the same table i want to print 2 columns of the single User
BestFriend.attributes.name
& BestFriend.attributes.surname
Logging every single user istance results in the relationship BestFriend
to be present and working (meaning that it contains type
& id
) but I noticed the lack of helpers methods to acces the related data attributes.
What i would like to be able to do is invoking a getter function on the User
instance where i define the relationship defined in my schema to populate the relationships fields.
Something like currentUserInstance.get('BestFriend').attributes.name
.
The only way to achieve this right now (atleast in the indexedDb source) is to manually invoke queryStore(q=>q.findRecord({type:'type from the relationship descriptor',id:'id from relationship descriptor'}))
manually on every single user instance, would be extra nice if the get
method could syntactical sugar coat
the process...
from react-orbitjs.
Got it.
It's however not really the goal for this project to provide a model/orm layer on top of Orbit, merely a reactive subscription/listener pattern to bind React and Orbit together.
Maybe https://github.com/exivity/orbit-client might be a better place for such functionality.
/cc @Michiel87
from react-orbitjs.
Related Issues (20)
- Dependency Dashboard
- withData is not rerendered after a replaceRelatedRecord operation with null HOT 1
- How do you do a proper network-first then cache approach? HOT 8
- Is this something you'd be ok with as a part of react-orbitjs? HOT 6
- The automated release is failing 🚨
- Silently fail when removing record HOT 5
- Typescript Conversion HOT 2
- Remove support for Node 12 HOT 1
- Add support for Node 18 HOT 1
- Bug: props mapRecordsToProps are not updated when returning empty object HOT 1
- Enhancement: Ability to return anything apart from just a record function HOT 1
- Ability to use with function components? HOT 3
- Huge performance problem with lots of subscriptions HOT 9
- Question: Use with Typescript HOT 3
- queryStore/updateStore are not always passed in
- removeRecord not rerendering HOT 1
- Legacy context API implementation - React 17.x readiness HOT 1
- Orbit 0.17 breaking change in fetching exception
- Node 15 & 16 support
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 react-orbitjs.