Skip to content

Conversation

@cah-brian-gantzler
Copy link
Collaborator

Exposes a method for the consumer to push mirage's database in the ember data store

If you call this method with no parameters, it will push the entire mirage store into ember store

You may also call this method with an array of resource names. ['accounts', 'accountTypes']. These must
be the resource names camelized.

You may also call it with a hash. This hash will have the resource names as the keys and the values will either
be true (push all records for that resource) or a where hash or function that will be applied to the that resource.
{
accounts: true,
accountTypes: { state: 'OH' }
users: item => item.name.includes("Joe")
}

@param server The mirage server
@param store the store you wish mirage to push to
@param config undefined means push all resources
An array will push only the resources in the array
hash in the form of resource=value Value may be true, all records, or a where hash or function

@bgantzler bgantzler force-pushed the push-mirage-into-store branch 2 times, most recently from 1767ffc to 719a6e7 Compare January 23, 2022 13:45
@cah-brian-gantzler
Copy link
Collaborator Author

Rebased and re-pushed this.

@bgantzler bgantzler force-pushed the push-mirage-into-store branch from 719a6e7 to c669c31 Compare January 23, 2022 14:03
@cah-brian-gantzler
Copy link
Collaborator Author

The linter fails on

Native JS classes should be used instead of classic classes ember/no-classic-classes

Its in my tests. But its the way that MirageJS Documents doing it. Pretty sure you have to use extend because of the way the base class works.

Should we lighten this lint or should I look into turning it off for this one file?

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.

1 participant