Skip to content

Instantly share code, notes, and snippets.

@felipecesr
Created February 24, 2019 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipecesr/65cb59eea6f9031bf3b5773e4b5c4b76 to your computer and use it in GitHub Desktop.
Save felipecesr/65cb59eea6f9031bf3b5773e4b5c4b76 to your computer and use it in GitHub Desktop.
import Bottle from 'bottlejs';
import { HttpClient } from './HttpClient';
import { PostsManager } from './PostsManager';
const bottle = new Bottle();
bottle.service('HttpClient', HttpClient);
bottle.service('PostsManager', PostsManager, 'HttpClient');
let postsManager = bottle.container.PostsManager;
postsManager.getPosts().then(posts => console.log('Posts: ', posts));
postsManager.getComments().then(comments => console.log('Comments: ', comments));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment