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

@trellisorg/angularfire-ngrx

v0.0.9

Published

This library is designed for hooking `angularfire` into an NgRx store so that you can listen on native NgRx actions whenever angularfire events are emitted.

Downloads

1

Readme

@trellisorg/angularfire-ngrx

This library is designed for hooking angularfire into an NgRx store so that you can listen on native NgRx actions whenever angularfire events are emitted.

This library is split into multiple modules similar to AngularFire such that you can only subscribe you actions for different parts of AngularFire.

Note: This is an alpha version of this package and is subject to change at any time.

Currently supported:

  1. Auth

In the works:

  1. Cloud Messaging

Including in your application

In your AppModule:

import { AngularFireNgrxModule } from '@trellisorg/angularfire-ngrx';

@NgModule({
    imports: [
        // other imports
        AngularFireNgrxModule.forRoot(),
        AngularFireNgrxAuthModule // Optional, this will dispatch AngularFireAuth actions to the store
    ]
})
export class AppModule {}

The .forRoot() method takes the following config:

{
    replay: boolean; // Whether to replay the last emitted value when the effect subscribes to the lifted observable merged from AngularFireAuth events
}

Actions

AngularFireAuth Actions

The following actions are dispatched based on what AngularFire Auth emits. Typically, named after the corresponding method in AngularFireAuth service that emits an observable.

export const authStateChanged = createAction(
    '[@angularfire-ngrx/auth/auth-state] Auth State changed',
    props<{ authState: User | null }>()
);

export const idTokenChanged = createAction(
    '[@angularfire-ngrx/auth/id-token] ID Token',
    props<{ idToken: string | null }>()
);

export const userChanged = createAction(
    '[@angularfire-ngrx/auth/user] User',
    props<{ user: User | null }>()
);

export const idTokenResultChanged = createAction(
    '[@angularfire-ngrx/auth/id-token-result] Id Token Result',
    props<{ idTokenResult: firebase.auth.IdTokenResult | null }>()
);

AngularFireMessaging Actions

The following actions are dispatched based on what AngularFire Messaging emits. Typically, named after the corresponding method in AngularFireMessaging service that emits an observable.

export const tokenChanges = createAction(
    '[@angularfire-ngrx/messaging/token-changes] Token Changes',
    props<{ token: string | null }>()
);

// afMessage instead of just message even though the message you would subscribe to is messages
export const afMessage = createAction(
    '[@angularfire-ngrx/messaging/messages] Receive new message from AngularFire Messaging',
    props<{ message: any }>()
);

The following actions can be dispatched to trigger methods on AngularFireMessaging. They will trigger effects that then dispatch a success or failed action.

export const requestPermission = createAction(
    '[@angularfire-ngrx/messaging/request-permission] Request Permission for Messaging'
);

export const requestToken = createAction(
    '[@angularfire-ngrx/messaging/request-token] Request a token from AngularFire Messaging'
);

Success and Failure Actions for the above:

export const requestPermissionSuccess = createAction(
    '[@angularfire-ngrx/messaging/request-permission-success] Request Permission for Messaging Successful'
);

export const requestPermissionFailed = createAction(
    '[@angularfire-ngrx/messaging/request-permission-failed] Request Permission for Messaging Failed',
    props<{ error: any }>()
);

export const requestTokenSuccess = createAction(
    '[@angularfire-ngrx/messaging/request-token-success] Request Token for Messaging Successful',
    props<{ token: string | null }>()
);

export const requestTokenFailed = createAction(
    '[@angularfire-ngrx/messaging/request-token-success] Request Token for Messaging Successful',
    props<{ error: any }>()
);

Other actions:

export const getToken = createAction(
    '[@angularfire-ngrx/messaging/get-token] Get Token From AngularFire Messaging'
);

export const gotToken = createAction(
    '[@angularfire-ngrx/messaging/got-token] Got Token From AngularFire Messaging',
    props<{ token: string | null }>()
);

export const deleteToken = createAction(
    '[@angularfire-ngrx/messaging/delete-token] Delete Token Associated with this Messaging instance'
);

export const tokenDeleted = createAction(
    '[@angularfire-ngrx/messaging/token-deleted] Whether the token was deleted or not',
    props<{ deleted: boolean }>()
);