All files / src InhabitAPI.js

100% Statements 7/7
100% Branches 0/0
100% Functions 3/3
100% Lines 7/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28                          3x 3x     1x       1x 2x 2x   2x    
//------------------------------------------------------------------------------
// Name: src/API.js
// Author: rand0me <not.randome@gmail.com>
// Timestamp: 2016-10-05T13:13:48.560Z
// Description:
//    InHabit API wrapper
//------------------------------------------------------------------------------
 
import PMClient from 'postmessage-client';
import Analytics from './lib/Analytics';
 
export default class InhabitAPI {
  constructor() {
    this.client = new PMClient();
    this.analytics = new Analytics(this.client);
  }
  getAnalytics() {
    return this.analytics;
  }
}
 
InhabitAPI.create = (moduleConfiguration) => {
  const api = new InhabitAPI();
  api.analytics.info = moduleConfiguration;
 
  return api;
}