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

greed-ember

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-ember

greed container for ember

  • 0.2.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Greed-Ember

Greed Container for Ember

Travis Codecov branch version downloads Donate MIT License

This modules purpose is to provide a more intimate abstraction for creating queries and mutations in ember 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-ember

Usage

import Ember from 'ember';
import pot from './greedInstance.js';
import { container } from 'greed-ember';

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