Code Monkey home page Code Monkey logo

shopify-api-flux's Introduction

Shopify API Flux

Build Status npm version

A flux implementation of the Shopify API.

Installation

npm install --save shopify-api-flux

Usage

This project uses ES6 (via Babel et al.). So the examples are in ES6. However, since the distribution (and main file in package.json) is actually compiled down to ES5, you should be able to use this in your ES5 projects without issue.

Please let me know (or open a PR) if this is not the case.

Examples

Currently, there is only one example but I intend to add more over time. For now there is a react native app in the examples/native directory that demonstrates creating and storing a session as well as fetching orders, products and shop details.

This will get fleshed out more as the API comes closer to complete.

Quick Start

import ShopifyAPI from "shopify-api-flux";

const { Session, Shop } = ShopifyAPI;

// set the Domain and API token
Session.init("YOUR_SHOP", "YOUR_API_TOKEN")

class ShopView extends React.Component {
  constructor(props) {
    super(props);
    this.state = { shop: null }
  }

  render() {
    return (
      // YOUR VIEW CODE
    );
  }

  componentWillMount() {
    Shop.store.addListener(this._onChange.bind(this));
  }

  componentDidMount() {
    Shop.fetch()
  }

  _onChange() {
    this.setState({ shop: Shop.store.getCurrent() });
  }
}

shopify-api-flux's People

Contributors

pseudomuto avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.