Skip to content

📋 App to fetch user data from Github API using ajax and rxjs

License

Notifications You must be signed in to change notification settings

AndrewJBateman/svelte-ajax-observables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Svelte AJAX Observables

  • Sveltejs sandbox using RxJS/AJAX to fetch API observable data.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • Displays API observable data such as Github user details
  • Note: Rxjs 'startWith' used to initialise fetch with an empty array
  • Note: Rxjs 'pluck operator deprecated - replaced with map()

📷 Screenshots

Frontend screenshot

📶 Technologies

  • Snowpack frontend build tool, alternative to webpack or Parcel etc.
  • Sveltejs/kit v3 fast front-end UI library with small bundles of highly-optimized vanilla JavaScript & declarative transitions. Does not use a virtual DOM.
  • RxJS Reactive Extensions JS library
  • RxJS/AJAX used to fetch Github API observable
  • Github REST API v2 RESTful API with data on all world countries. Get a Github access token so API access not limited

💾 Setup

  • npm i to install dependencies
  • npm run dev to run dev server on port localhost:8080. Note: I had to check dev tools/network/Disable cache to prevent caching and to see changes to files
  • npm run build to build a static copy of app to a build/ folder
  • npm run start to run build files on port localhost:8080

🔧 Testing

  • N/A

💻 Code Examples

  • userCard.svelte with HTML that has been extended using Svelte-specific syntax.
<main>
  <h3>Github User Infomation</h3>
  <UserCard {user} />
  <br />
  <h3>List of repos with links that contain 'svelte'</h3>
  {#each $reposObservable as r}
    <div>
      <a href={r.url}>{r.name}</a>
    </div>
  {/each}
</main>

🆒 Features

  • Observables can be displayed in Svelte markup with a preceding $

📋 Status & To-Do List

  • Status: Working
  • To-Do: Try out more RxJS methods

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact

About

📋 App to fetch user data from Github API using ajax and rxjs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published