Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

greed-angular

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

greed-angular

greed container for angular

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Greed-Angular

Greed Container for Angular

Travis Codecov branch version downloads Donate MIT License

This modules purpose is to provide a more intimate abstraction for creating queries and mutations in angular applications. This module itself uses the greed module under the covers. Hopefully this abstraction lends itself well to you when knee deep in application level code.

Install

npm install --save greed-angular

Usage

import Angular from 'angular';
import pot from './greedInstance.js';
import { container } from 'greed-angular';

function someComponent () {
  ...
}

//default
export default container(
  someComponent,
  containerDefaults(props),
  containerQueries(props),
  containerMutations(props)
);

function containerDefaults (props) {
  return {
    vars: {
      id: 0
    },
    count: gql`
      count: (id: $id){
        count
      }
    `
  };
}

function containerQueries (props) {
  return {
    vars: {
      id: 0
    },
    loadMoreCounts: gql`
      count: (id: $id){
        count
      }
    `
  };
}

function containerMutations (props) {
  return {
    vars: {
      id: 0
    },
    incrementCount (handler) {
      gql`
        count: (id: $id){
          count
        }
      `;
      return handler(result);
    },
    decrementCount (handler) {
      gql`
        count: (id: $id){
          count
        }
      `;
      return handler(result);
    }
  };
}

Keywords

FAQs

Package last updated on 12 Nov 2016

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