question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support non-blocking model hook

See original GitHub issue

Seems like ember-infinity cannot support a non-blocking model hook, the failure is in the way the route mixin asks the ‘infinityModel’ that is passed to it from the infinity-loader for state. The infinityModel that the infinity-loader passes around is not promise aware.

For example, this does not work:

export default Ember.Route.extend(InfinityRoute, {
  model() {
    return {
      posts: this.infinityModel('post', {
          modelPath: 'controller.model.posts',
          perPage: 10,
          startingPage: 1
      }),
    };
  }
});

I have a fork where I have fixed this. Basically, we just need to have promise support all-ova-the-place.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Duder-onomycommented, Aug 30, 2017

Sounds great! I will try the 1-0 branch today at work and see if our test suite passes. Looking forward to getting the non-blocking PR (or something that solves the same issue) into this project. We are using it a ton @ thedyrt.com. Checkout our dogs page, uses Amazon image recognition service to make a page of all the dogs on our site, of course, using ember-infinity.

Anyhow, looking forward to the 1-0. I also have an infinity loader that works with horizontal scrolling things you might want to lazy load, I will dust it off and see if it is worthy of a PR.

0reactions
snewcomercommented, Nov 7, 2017

@Duder-onomy Everything you said seems legit. Really appreciate the thought in the above comment! 👊

I think ember-in-viewport is a great addition we can add to this. Looking to get 1-0 in by the end of the year so let’s see where this falls in priorities. I’ll create an issue and we can figure out when to tackle.

The deprecation warnings I’ll try to fix in an existing PR tonight or tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Making The Model Hook Not Block Rendering - Ember.JS
What I'm proposing is that there is some API that I can call similar to what I'm doing here, that allows for non-blocking...
Read more >
Blocking Hook - Win32 apps - Microsoft Learn
The Winsock service provider calls the blocking hook only if all of the ... If only nonblocking sockets and WSPAsyncSelect/WSPEventSelect ...
Read more >
Implementing a non-blocking cross-service communication ...
In this article, you will understand the basics of non-blocking cross-service communication with WebClient, reactive WebSocket API, ...
Read more >
Uplift Your Java Spring Boot To WebFlux Non-Blocking ...
Since I/O operations are asynchronous, the method calls work in a pub/sub model such that the method invocation will immediately return a ...
Read more >
How do I change a TCP socket to be non-blocking?
ahh well I think it's time to provide an updated answer. – hookenz. Mar 11, 2014 at 23:55. 5.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found