flarum / flarum/issue-archive

Rewrite Controls utils objects

Open
#175 6 comments 0 reactions 0 assignees View on GitHub
type/cleanup
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Feature Request

Here's a screenshot of the before (left) and after:
![image](https://user-images.githubusercontent.com/36057469/97195939-764f0200-17de-11eb-8475-d7b6ebdf491f.png)

The biggest benefit is that when calling the function one doesn't have to use `.call(discussion)` anymore and the code becomes more readable. Another benefit is that you can call one utils function from another in the same file, which was previously impractical, since `this` was already bound to the discussion.

Applies to `PostControls`, `DiscussionControls`, `UserControls`. Can be done probably when converting these files to TypeScript.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.