New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ember-particle

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-particle

Ember service for the Particle API

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

ember-particle

Build Status npm version Ember Observer Score

ember-particle is an addon for Ember.js providing an injectable service that acts as a wrapper around the Particle API.

Installation

ember install ember-particle

Usage

ember-particle enables all functions identical to their API as it is just a wrapper.

API Documentation

Complete API docs for all Particle.io methods are available at the JS SDK doc site https://docs.particle.io/reference/javascript/

Examples

login(username, password)

Login a user with a username and password:

//...
import { inject as service } from '@ember/service';

export default Controller.extend({
  particle: service('particle'),

  actions: {
    loginToParticle(username, password) {
      this.get('particle')
        .login(username, password)
        .then((success) => {
          alert('you logged into particle! huzzah!');
        })
        .catch((error) => {
          alert('Something went terribly wrong', error);
        });
    }
  }
});

Device Info

listDevices()

List devices for a user

//...
import { inject as service } from '@ember/service';

export default Controller.extend({
  particle: service('particle'),
  devices: this.get('particle').listDevices()
});
getDevice(deviceId)

Gets all attributes for a device

//...
import { inject as service } from '@ember/service';

export default Controller.extend({
  particle: service('particle'),
  device: this.get('particle').getDevice('asdf1234')
});

Contributing

I'm always happy to take on PRs. Here is how to get up and running:

Installation

  • git clone https://github.com/mileszim/ember-particle this repository
  • cd ember-particle
  • yarn install

Running

  • npm run lint:hbs
  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.

Keywords

ember-addon

FAQs

Package last updated on 18 Oct 2018

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