Skip to content

ember-links/misc-useful

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Misc useful Ember


Lazy loading images in viewport

If you are looking for a responsive, lazy loaded artwork component that has fallback artwork and handles user monograms, take a look at the dummy-artwork component! Also 3.5.8 released of ember-in-viewport. I'm convinced this may be one of the more performance tuned, fully featured, battle tested viewport detection libraries out there.

Link to test in Ember viewport github repo


Return from Pushpayload

If you rely on the ds-pushpayload-return feature flag, you can use the following pattern to manually serialize the API response and push the record into the store.

utils/push-payload.js

export function pushPayload(store, modelName, rawPayload) {
   let ModelClass = store.modelFor(modelName);
   let serializer = store.serializerFor(modelName);

   let jsonApiPayload = serializer.normalizeResponse(store, ModelClass, rawPayload, null, 'query');

  return store.push(jsonApiPayload);
}
import { pushPayload } from '<app-name>/utils/push-payload';

...

pushPayload(this.get('store'), modelName, rawPayload);

Link to official Ember blog article

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors