Practical Application Development with AppRun by Yiyi Sun
Author:Yiyi Sun
Language: eng
Format: epub
ISBN: 9781484240694
Publisher: Apress
The stories posted to Hacker News are categorized as Top, New, Best, Show, Ask, and Jobs. The story list of each category has the Firebase database reference. We can get the Firebase database reference of the story list (line 5). Also, we can get the Firebase database reference of the story detail (line 6).
The Story List
The Firebase story list reference publishes the value event with an array of at most 500 story IDs when the application connects to Firebase; in addition, the story list has updates at the server side. We can create the getList function to subscribe to the value event to get the story IDs (Listing 6-7).1. export const getList = (category, min, max) => {
2. const ref = db.child(`${category}stories`);
3. ref.on('value', async snapshot => {
4. const items = await Promise.all(snapshot.val().map((id, idx) =>
5. (idx >= min && idx < max && (typeof id === 'number')) ?
6. fetchJSON(`item/${id}`) : id
7. ));
8. app.run('refresh', category, { min, max, items });
9. });
10. };
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Fifty Quick Ideas to Improve Your Tests by Gojko Adzic David Evans and Tom Roden(844)
Hands-On RESTful Web Services with ASP.NET Core 3 by Samuele Resca(703)
CSS 3 Visual Learning Guide: a comprehensive example set for getting up to speed fast by Ludo Mike(529)
PHP 7 Solutions by David Powers(434)
React js: The Ultimate Beginner's Guide to Learn React js Programming Step by Step - 2020 by Peterson Kathleen(427)
Getting Started with the Internet of Things by Pfister Cuno(383)
Beginning Git and GitHub by Mariot Tsitoara(379)
HTML 5 Visual Learning Guide: a comprehensive example set for getting up to speed fast by Ludo Mike(365)
Getting a Coding Job For Dummies by Nikhil Abraham(363)
Programming PHP by Kevin Tatroe Peter MacIntyre & Rasmus Lerdorf(322)
Magento 2 Development Cookbook by Bart Delvaux(321)
Programming PHP by Kevin Tatroe(303)
Creating Data-Driven Web Sites by Bob Terrell(302)
Full Stack Serverless by Nader Dabit(295)
Manifesto Comunista by Friedrich Engels(294)
Getting Started with OAuth 2.0 by Boyd Ryan(290)
Practical Oracle JET by Daniel Curtis(290)
gRPC by Kasun Indrasiri(278)
Building Web Applications with Erlang by Zachary Kessin(274)
