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

reactive-ionic

v0.0.8

Published

This library is a collection of modules to make it easier to use NgRx and Ionic together. All the modules are simply wrappers for the same Ionic implementation under the hood.

Downloads

7

Readme

ReactiveIonic

This library is a collection of modules to make it easier to use NgRx and Ionic together. All the modules are simply wrappers for the same Ionic implementation under the hood.

View on npm.

ReactiveLoadingSpinnerModule

TODO: allow standard loading spinner configurations to be passed as args.

Use this module to control whether the Ionic loading spinner shows or is hidden based on NgRx store values (declarative), rather than explicitly having to call create / dismiss (imperative).

Setup

(1) Import ReactiveLoadingSpinnerModule into your app module, and pass your loading reducer to the forRoot method:

# app.module.ts
...
import { ReactiveLoadingSpinnerModule } from "reactive-ionic";
import { myLoadingReducer } from "./providers/loading/loading.reducer";

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    ReactiveLoadingSpinnerModule.forRoot({ reducer: myLoadingReducer })
  ],
  providers: [
    ...
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

(2) Add the ReactiveLoadingSpinnerComponent to your app component template:

<!-- app.component.html -->
<ion-app>
  <ion-router-outlet></ion-router-outlet>
</ion-app>

<reactive-loading-spinner></reactive-loading-spinner>

(3) In your reducer, control the visibility, message and css class of the built-in Ionic loading spinner by setting the isLoading, message and cssClass store values.

...
import { LoadingState } from "reactive-ionic/lib/reactive-loading-spinner/state/loading.state";
import { StoreAction } from "../../state/store-action.interface";

const initialState: LoadingState = {
  isLoading: false,
  message: null,
  cssClass: null
};

export function loadingReducer(state: LoadingState = initialState, action: StoreAction): LoadingState {

  switch (action.type) {

    case MyActions.REQUEST:
      return {
        isLoading: true,
        message: "Request in progress",
        cssClass: "my-request-spinner"
      };

    case UserActions.REQUEST_SUCCESS:
    case UserActions.REQUEST_FAILURE:
      return {
        ...inititalState
      };

    default:
      return state;
  }
}

##ReactivePopupModule

Use this module to show, hide and set the contents of an Ionic popup based on NgRx store values (declarative), rather than explicitly having to call create and assigning callbacks (imperative).

Setup

(1) Import ReactivePopuprModule into your app module, and pass your popup reducer to the forRoot method:

# app.module.ts
...
import { ReactivePopuprModule } from "reactive-ionic";
import { myPopupReducer } from "./providers/popup/popup.reducer";

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    ReactivePopuprModule.forRoot({ reducer: myPopupReducer })
  ],
  providers: [
    ...
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

(2) Add the ReactivePopupComponent to your app component template:

<!-- app.component.html -->
<ion-app>
  <ion-router-outlet></ion-router-outlet>
</ion-app>

<reactive-popup></reactive-popup>

(3) In your reducer, control the visibility, contents and class of the built-in Ionic popup, and any buttons and the actions they should dispatch.

...
import { PopupState } from "reactive-ionic/lib/reactive-popup/state/popup.state";
import { StoreAction } from "../../state/store-action.interface";

const initialState: PopupState = null;

export function loadingReducer(state: PopupState = initialState, action: StoreAction): PopupState {

  switch (action.type) {

    case UserActions.INITIATE_SOME_FLOW:
      return {
        header: "Confirm",
        message: "Are you sure you want to do this?",
        cssClass: "my-popup",
        buttons: [
            {
                text: "Yes",
                cssClass: "my-popup-ok",
                action: new MyActions.MyPopupConfim()
            },
            {
                text: "No",
                cssClass: "my-popup-cancel",
                action: new MyActions.MyPopupCancl()
            }
        ]
      };

    default:
      return state;
  }
}