@fabrix/spool-pgpubsub
    TypeScript icon, indicating that this package has built-in type declarations

    1.6.1 • Public • Published

    spool-pgpubsub

    Gitter NPM version Build Status Test Coverage Dependency Status Follow @FabrixApp on Twitter

    Conventional Commits

    📦 PgPubsub Spool PG Listen

    Utilizes PG Listen to add a Fabrix Extension

    Install

    $ npm install --save @fabrix/spool-pgpubsub

    Configure

    // config/main.ts
    import { PgPubsubSpool } from '@fabrix/spool-pgpubsub'
    export const main = {
      spools: [
        // ... other spools
        PgPubsubSpool
      ]
    }

    Configuration

    // config/pgpubsub.ts
    export const pgpubsub = {
    
    }
    

    Usage

    const sayHello = (payload) => {
        // Do something with Payload when an event is published to channel
        console.log(payload)
    }
     
    // Add a Channel
    this.app.spools.pgpubsub.subscribe(name, sayHello)
     
     
    // Publish to the Channel
    this.app.spools.pgpubsub.publish(name, data)
     
     
    // Completely rid the channel
    this.app.spools.pgpubsub.unsubscribe(name, sayHello)

    Install

    npm i @fabrix/spool-pgpubsub

    Homepage

    fabrix.app

    DownloadsWeekly Downloads

    3

    Version

    1.6.1

    License

    MIT

    Unpacked Size

    27.9 kB

    Total Files

    40

    Last publish

    Collaborators

    • scottbwyatt