Code Monkey home page Code Monkey logo

angularstart-giflist's People

Contributors

joshuamorony avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

angularstart-giflist's Issues

How would you resolve pagination

Hi,

I really like the pattern, but in your example you have a pagination based on the lastGif,
but changing it to a normal pagination, would you still do the same? or move it to the state?

I worked the following out, but when I change the filter, I wanted to reset the page number, and this felt wrong on how to do this.

 //sources
  pagination$ = new BehaviorSubject<number>(1);
  private error$ = new Subject<string | null>();
  private filterChanged$ = this.filter.valueChanges.pipe(
    tap(() => this.pagination$.next(1)),
    debounceTime(300),
    distinctUntilChanged(),
  );

  private gamesLoaded$ = this.filterChanged$.pipe(
    switchMap((filter) =>
      this.pagination$.pipe(
        distinctUntilChanged(),
        mergeMap((page) => this._loadRecentGamesForPlayer(filter, page)),
      ),
    ),
  );

Do you have any suggestions / examples for this?

Duplicated data retrieval

There is a bug in the gifsLoaded$ stream that cause the retrieval of duplicated data (fetch url with same params, or overlapping requests)

  • Scroll events can happen while fetching data from a previous scroll
  • The expand is loading data and there are scroll events

I think both can be fixed by disabling the ngx-infinite-scroll directive with infiniteScrollDisabled input set to true while fetching, using another boolean variable in the state, isFetching, for example. This will be set to true when loading and to false once the last data has been fetched (when expands emits EMPTY). I haven't tested this possible fix, though.

Thanks for such a great course, I'm learning a lot! ๐Ÿฅฐ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.