Skip to content

Commit

Permalink
feat: add initial support for Subreddits
Browse files Browse the repository at this point in the history
This only adds basic functionality, there is still a lot left to do here.
  • Loading branch information
thislooksfun committed Apr 8, 2021
1 parent 1b5ca36 commit b5f09ea
Show file tree
Hide file tree
Showing 6 changed files with 1,294 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Data } from "./helper/types";
import type { OauthOpts } from "./helper/api/oauth";
import type { Query } from "./helper/api/core";
import type { Token } from "./helper/accessToken";
import { CommentControls, PostControls } from "./controls";
import { CommentControls, PostControls, SubredditControls } from "./controls";
import * as anon from "./helper/api/anon";
import * as oauth from "./helper/api/oauth";
import refreshToken from "./helper/accessToken";
Expand Down Expand Up @@ -127,6 +127,9 @@ export default class Client {
public comments: CommentControls;
/** Controls for interacting with posts. */
public posts: PostControls;
/** Controls for interacting with subreddits. */
public subreddits: SubredditControls;

protected auth?: Auth;
protected creds?: Credentials;
protected token: Token | null;
Expand All @@ -146,6 +149,7 @@ export default class Client {
// Set up controls after we have initalized the internal state.
this.comments = new CommentControls(this);
this.posts = new PostControls(this);
this.subreddits = new SubredditControls(this);
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/controls/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { default as BaseControls } from "./base";
export { default as SubredditControls } from "./subreddit";
export { default as VoteableControls } from "./voteable";
export { default as CommentControls } from "./comment";
export { default as PostControls } from "./post";

0 comments on commit b5f09ea

Please sign in to comment.