Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ng-web-apis/common

Package Overview
Dependencies
Maintainers
4
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ng-web-apis/common

A set of common utils for consuming Web APIs with Angular

  • 1.11.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31K
increased by20.89%
Maintainers
4
Weekly downloads
 
Created
Source

Common utils for Web APIs

Part of Web APIs for Angular

npm version npm bundle size .github/workflows/ci.yml Coveralls github

A set of common utils for consuming Web APIs with Angular

Tokens

  • WINDOW — provides access to global window object
  • NAVIGATOR — provides access to window.navigator object
  • NETWORK_INFORMATION — provides access to window.navigator.connection object
  • USER_AGENT — provides access to window.navigator.userAgent string
  • PERFORMANCE — provides access to window.performance object
  • ANIMATION_FRAME — shared Observable based on window.requestAnimationFrame
  • CACHES — provides access to window.caches object
  • CSS — provides access to window.CSS object or mock object if it's not available (i.e. in IE)
  • LOCATION — provides access to window.location object
  • LOCAL_STORAGE — provides access to window.localStorage object
  • SESSION_STORAGE — provides access to window.sessionStorage object
  • SPEECH_RECOGNITION — provides access to SpeechRecognition class or returns null if browser does not support it
  • SPEECH_SYNTHESIS — provides access to window.speechSynthesis object
  • PAGE_VISIBILITY — wrapper for document.addEventListener('visibilityChange') api
  • HISTORY — provides access to window.history object

How to use

Just inject a token you need. You can also take a look at Stackblitz sample

What advantages do we get from abstract entities in our app?

👨‍🎓 It is easy to understand: you see all dependencies of your entity in its constructor

🧞 It is easy to test: you can just mock any of your dependencies to test

🧩 It is easy to reuse: your components and directives can be used in any context if it has dependencies that they need to be created

♻️ It is environment agnostic: you can start your app in SSR or other environments (see also @ng-web-apis/universal)

See also

Other Web APIs for Angular by @ng-web-apis

Core team

Alex Inkin
Alex Inkin
Roman Sedov
Roman Sedov

Keywords

FAQs

Package last updated on 29 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc