angularstart-giflist's People
angularstart-giflist's Issues
Minor bug. When clearing subreddit value from search bar , it doesnt show back 'gifs' (default) gifs.
When clearing the search bar, it should show default gifs again. It isn't doing this as subreddit is null in https://www.reddit.com/r/${subreddit}/hot/.json?limit=100
.
Solution: We can add map operator to subredditChanged$ - if subreddit is null, then return 'gifs'; else return as it is;
P.S : Really inspired by the reactive nature of your code. ๐ฅ
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.