2.0.2 • Published 2 months ago

@smals-belgium/myhealth-wc-integration-angular v2.0.2

Weekly downloads
-
License
LGPL-3.0-or-later
Repository
github
Last release
2 months ago

MyHealth - Web Component Integration for Angular

Collection of Angular goodies to help build MyHealth Web Components.

Based on Angular v19

This library is published to the NPM registry at: https://www.npmjs.com/package/@smals-belgium/myhealth-wc-integration-angular

Documentation

BaseWebComponent (component class)

Abstract base component class that can be used as a base class to implement MyHealth web components.

This class defines the inputs and outputs according to the MyHealth specification and provides the following goodies:

  • validate the given version info and ensure it is compatible with the version of the spec used by this component
  • validate the inputs to ensure they have been set and have the right content
  • possibity to add extra required input that needs to be validated using extraRequiredFields
  • provides a onPropsChanged() method as a convenience to handle input changes

BaseDataFetchHelper<T> (helper class)

Absract base helper class that can be used to manage fetching data from either the cache, the offline store or the actual backend.

When getting data, the logic is to:

  • look in the cache first (using the provided cacheKey),
  • look in the offline store (if provided and using the provided offlineKey)
  • finally fetch the data from the backend (by way of the abstract getDataFromBackend() method)

After having retrieved the data, this class will also properly populate the cache and offline store (if provided)

Utilities

const delay = async function<T>(ms:number, fn:()=>Promise<T>): Promise<T>

Return a promise that will be resolved with the value (of type T) returned by fn(), which is invoked after ms milliseconds

const isMobileNative = (): boolean

Return true if embedded in a mobile native application (e.g. Ionic)

const isTouchDevice = (): boolean

Return true if this is a touch device (smartphone, tablet, etc.)

2.0.2

2 months ago

2.0.1

2 months ago

2.0.0

2 months ago

1.3.0

4 months ago

1.2.5

5 months ago

1.2.4

5 months ago

1.2.3

5 months ago

1.2.1

5 months ago

1.1.2

6 months ago

1.1.0

6 months ago