Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
Disabled member ordering linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tejas Kumar committed Jul 16, 2018
1 parent a975353 commit 456979c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "restful-react",
"description": "A declarative client from RESTful React Apps",
"version": "4.0.0-3",
"version": "4.0.0-4",
"main": "dist/index.js",
"license": "MIT",
"files": [
Expand Down
14 changes: 7 additions & 7 deletions src/Get.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ export interface GetComponentState<T> {
class ContextlessGet<T> extends React.Component<GetComponentProps<T>, Readonly<GetComponentState<T>>> {
private shouldFetchImmediately = () => !this.props.wait && !this.props.lazy;

public readonly state: Readonly<GetComponentState<T>> = {
data: null, // Means we don't _yet_ have data.
response: null,
error: "",
loading: this.shouldFetchImmediately(),
};

private getRequestOptions = (
extraOptions?: Partial<RequestInit>,
extraHeaders?: boolean | { [key: string]: string },
Expand Down Expand Up @@ -147,13 +154,6 @@ class ContextlessGet<T> extends React.Component<GetComponentProps<T>, Readonly<G
return data;
};

public readonly state: Readonly<GetComponentState<T>> = {
data: null, // Means we don't _yet_ have data.
response: null,
error: "",
loading: this.shouldFetchImmediately(),
};

public componentDidMount() {
if (this.shouldFetchImmediately()) {
this.fetch();
Expand Down
16 changes: 8 additions & 8 deletions src/Poll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ class ContextlessPoll<T> extends React.Component<PollProps<T>, Readonly<PollStat

private keepPolling = !this.props.lazy;

public readonly state: Readonly<PollState<T>> = {
data: null,
loading: !this.props.lazy,
lastResponse: null,
polling: this.keepPolling,
finished: false,
};

/**
* This thing does the actual poll.
*/
Expand Down Expand Up @@ -179,14 +187,6 @@ class ContextlessPoll<T> extends React.Component<PollProps<T>, Readonly<PollStat
this.setState(() => ({ polling: false, finished: true })); // let everyone know we're done here.}
};

public readonly state: Readonly<PollState<T>> = {
data: null,
loading: !this.props.lazy,
lastResponse: null,
polling: this.keepPolling,
finished: false,
};

public componentDidMount() {
const { path, lazy } = this.props;

Expand Down
17 changes: 1 addition & 16 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@
"completed-docs": false,
"import-spacing": true,
"match-default-export-name": true,
"member-ordering": [
true,
{
"order": [
"private-static-field",
"public-static-field",
"private-constructor",
"public-constructor",
"private-instance-field",
"private-instance-method",
"protected-instance-method",
"public-instance-field",
"public-instance-method"
]
}
]
"member-ordering": false
}
}

0 comments on commit 456979c

Please sign in to comment.