Comments (3)
Have you thought much about this design? I can help implement it (I'll be working on something related soon).
from ember-jsonapi-resources.
@barelyknown haven't thought to much about it yet, other than I'd like to to be super flexible. I'd rather developers have control over the caching rules for their apps. This rfc https://github.com/jcollins1991/rfcs/blob/master/active/0000-data-loading-methods.md made me think that every app will have it's own needs for getting from cache in memory or from fetching from the server.
Awhile back I built a JS framework that would get from storage if not expired then fetch from server. So my initial though is that in the helpers for hasOne
and hasMany
we'll need hook to get from cache that developer can define how they want to do that. the default implementation can have a expiresIn
value on the resource prototype and use the cache if that resource has a meta timestamp that is less than the expires time, e.g. 7 minutes or something like that. Also It would be awesome to honor the expires headers / etag from the fetch response headers.
Also by giving that hook not the resource (model) some data can be even set on localStorage and read there too.
from ember-jsonapi-resources.
I agree that a one-size-fits-all solution will be elusive. A solid set of hooks, maybe some out-of-the-box support for common strategies, and a cookbook of examples would be great.
Perhaps that means that we should start with the cookbook. As we implement examples of common strategies the abstraction will emerge.
from ember-jsonapi-resources.
Related Issues (20)
- Proposal: Include ember-getowner-polyfill HOT 3
- [question] Make related-proxy computed property volatile? HOT 6
- changedRelationships does not track first hasOne HOT 4
- [question] Similaries/differences with `DS.JSONAPIAdapter`? HOT 1
- Broken build with older version of fetch & es6-promise packages
- Replace fetch mixin with ember-fetchjax addon
- Name Relationship helper: toMany and toOne
- Ember Inspector `Data` tab is throwing an error HOT 2
- changedAttributes and changedRelationships not live. HOT 1
- Fix ember-beta [2.12.0-beta.2] test failures.
- Can not handle 204 no content for updating resources. HOT 2
- Full tests
- Looking for a new maintainer HOT 1
- Update to authorization mixin to support ember-simple-auth 1.0 HOT 1
- Update docs for [create|patch|delete]Relationship service methods HOT 1
- model generator/blueprint broken? HOT 4
- Move Resource#updateRelationship to a mixin
- has-one relation may be empty so need to handle a `data: null` response
- [Question] Working with Katharsis dialect for included resources, sorting, and sparse fieldsets HOT 1
- Proposal: Change key 'resource' to 'relation' in hasOne/hasMany object param. 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 ember-jsonapi-resources.