New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@glue42/ng-glue

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glue42/ng-glue

Glue42 library for Angular

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
4
Weekly downloads
 
Created
Source

NgGlue42

Installation

npm install @glue42/desktop @glue42/ng-glue

Importing the Glue42 NgModule

Once installed NgGlue42Module needs to be imported and the static method withConfig to be invoked with an optional configuration. withConfig inits an instance of Glue library:

import { NgGlue42Module } from '@glue42/ng-glue';

@NgModule({
  imports: [
    NgGlue42Module.withConfig({})
  ]
})
export class AppModule { }

Using the library

Start using by injecting any of the provided API into your components and services. For example: In one app listen for a certain method to be registered and immediately invoke it when it becomes available:

import { Component, OnInit } from '@angular/core';
import { InteropService } from '@glue42/ng-glue';
import { mergeMap } from 'rxjs/operators';

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html'
})
export class AppComponent implements OnInit {

  constructor(public interopService: InteropService) { }

  ngOnInit(): void {
    this.interopService.methodRegistered({ methodName: 'Sum' })
      .pipe(
        mergeMap(
          () => this.interopService.invoke('Sum', { a: 37, b: 5 })
        )
      ).subscribe(result => {
        console.log(`The result of 37 + 5 is ${result.returned.answer}`);
      });

  }
}

In another app register the method:

this.interopService.register('Sum', ({ a, b }) => ({ answer: a + b }))
  .subscribe(
    method => console.log(`Method "${method.name}" is registered.`),
    error => console.log(`Couldn't register method "Sum"`, error)
  );

Keywords

FAQs

Package last updated on 04 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc