npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@egym/mwa-utils

v0.5.2

Published

## Install ``` npm install --save @egym/mwa-utils ```

Downloads

407

Readme

Usage

Install

npm install --save @egym/mwa-utils

API

  1. getPortalsInitialContext is the same as getInitialContext from the standard @ionic/portals package, but with support for both v4 and v5 Capacitor versions
  2. portalsPublish is the same as publish from the standard @ionic/portals package, but with extra logging with the help of @egym/mwa-logger
  3. portalsSubscribe is the same as subscribe from the standard @ionic/portals package, but with extra logging with the help of @egym/mwa-logger

EGYM BMA Specific Functionality

MWA Functions

  1. getMwaInitialContext() returns the initial context typed as MwaInitialContext.

MWA Commands

The following functions are available to send commands to the BMA:

  1. publishAuthToken() publishes the authToken to the BMA.
  2. publishDismiss() publishes the dismiss command to the BMA.
  3. publishExerciserInfo() publishes the exerciserInfo to the BMA.
  4. publishOpenFeature(startingRoute: string) publishes the openFeature command to the BMA.
    • startingRoute is the route to open the feature at.
  5. publishOpenNativeFeature(featureId: string, data?: { [key: string]: string }) publishes the openNativeFeature command to the BMA.
    • featureId is the id of the feature to open.
    • data is an optional object with key-value pairs to pass to the feature.
  6. publishOpenWebView(url: string, endFlowUrlPatterns: string[] = []) publishes the openWebView command to the BMA.
    • url is the url to open in the webview.
    • endFlowUrlPatterns is an optional array of strings that will be used to close the webview when a url matches any of the patterns.
  7. publishOpenUrlExternally(url: string) publishes the openUrlExternally command to the BMA.
    • url is the url to open in the external web view.
  8. publishTrackEvent(eventName: string, parameters?: { [key: string]: string }) publishes the trackEvent command to the BMA.
    • eventName is the name of the event to track.
    • parameters is an optional object with key-value pairs to pass to the event.

MWA Subscriptions

The following functions are available to subscribe to the BMA messages:

  1. subscribeBack(callback: (result: PortalMessage<void>) => void) subscribes to the back subscription. The BMA will send a back message when the user presses the back button for instance.
    • callback is a function that will be called when the back message is received.
  2. subscribeAuthToken(callback: (result: PortalMessage<string>) subscribes to the authToken subscription. The BMA will send the authToken message when the MWA send the command publishAuthToken().
    • callback is a function that will be called when the authToken message is received.
  3. subscribeExerciserInfo(callback: (result: PortalMessage<MwaExerciserInfo>) => void) subscribes to the exerciserInfo subscription. The BMA will send the exerciserInfo message when the MWA send the command publishExerciserInfo().
    • callback is a function that will be called when the exerciserInfo message is received.

MWA Flows

The MWA Flows are an abstraction that combines the commands and subscriptions to provide a more user-friendly API. The following functions that implement the MWA Flows are available:

  1. getAuthTokenFlow() returns a promise that resolves with the authToken sent by the BMA over the authToken subscription topic. When this function is invoked, the subscription to the authToken is done as part of invocation, and, the authToken command is sent to the BMA. When the BMA send the authToken message, the promise resolves with the message data and unsubscribes from the authToken subscription.
  2. getExerciserInfoFlow() returns a promise that resolves with the exerciserInfo sent by the BMA over the exerciserInfo subscription topic. When this function is invoked, the subscription to the exerciserInfo is done as part of invocation, and, the exerciserInfo command is sent to the BMA. When the BMA App send the exerciserInfo message, the promise resolves with the message data and unsubscribes from the exerciserInfo subscription.

Modern.js Package

Setup

Install the dependencies:

npm run install

Get Started

Run and debug the module:

npm run dev

Run test cases:

npm run test

Build the module for production:

npm run build

Enable optional features:

npm run new

Other commands:

npm run lint         # Lint and fix source files
npm run change       # Add a new changeset
npm run bump         # Update version and changelog via changeset
npm run release      # Release the package

For more information, see the Modern.js Module documentation.