Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record accessors #278

Closed
wants to merge 4 commits into from
Closed

Record accessors #278

wants to merge 4 commits into from

Conversation

tchak
Copy link
Member

@tchak tchak commented Jul 5, 2020

This is an iteration over #240 and #241. I think ultimately we could deprecate almost all of store/cache finder methods.

store.record({ type: 'planet', id: '1' }).peek();
await store.record({ type: 'planet', id: '1' }).query();
await store.record({ type: 'planet', id: '1' }).remove();
await store.record({ type: 'planet', id: '1' }).update({ name: 'Earth' });

store.records('planet').peek();
store.records('planet').filter({ attribute: 'name', value: 'Earth' }).peek();
store.records('planet').filter({ attribute: 'name', value: 'Earth' }).raw();
store.records('planet').filter({ attribute: 'name', value: 'Earth' }).live();
await store.records('planet').query();
await store.records('planet').filter({ attribute: 'name', value: 'Earth' }).query();
await store.records('planet').add({ name: 'Jupiter' });

record.relatedRecords('moons').peek();
record.relatedRecords('moons').filter({ attribute: 'name', value: 'Moon' }).peek();
record.relatedRecords('moons').filter({ attribute: 'name', value: 'Moon' }).live();
await record.relatedRecords('moons').query();
await record.relatedRecords('moons').filter({ attribute: 'name', value: 'Moon' }).query();
await record.relatedRecords('moons').add({ type: 'moon', id: '1' });
await record.relatedRecords('moons').remove({ type: 'moon', id: '1' });
  • Add deprecations
  • Add tests

@dgeb dgeb closed this Feb 10, 2021
@dgeb dgeb deleted the branch orbitjs:master February 10, 2021 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants