You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I receive JSONAPI payload from a websocket which I normalise and insert into the store, like so:
Route ( with InfinityRoute mixin ):
createChatMessage(JSONApiPayload) {
const store = this.get('store');
const record = store.push(store.normalize('chat-message', JSONApiPayload));
// Update the infinityModel with the new record..
}
How should I insert this new record into the infinityModel ( properly )?
For now I extended the ember-infinity mixin with 2 public methods:
We currently do this: return infinityModel.pushObjects(newObjects.get('content'));
Which I don't love.
Currently all the methods that Ember Infinity use to populate the infinityModel are private - that's mostly by design, but we for sure need a more "supported" way for users to update their data.
This is partly related to #151 - we need a method of "creating" a new array from a supplied bit of data, and the current set. Would love to know your thoughts here!
I receive JSONAPI payload from a websocket which I normalise and insert into the store, like so:
Route ( with InfinityRoute mixin ):
How should I insert this new record into the infinityModel ( properly )?
For now I extended the ember-infinity mixin with 2 public methods:
Which I found in the open PR: #107
Then in my route I added the call to pushRecord like so:
My quick solution works, but there must be a better way? Any help on this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: