From 2db3b84b116e5eb88f04b4c98aa13c0285ffce5d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 3 Aug 2019 13:26:20 -0700 Subject: [PATCH] Adding a debounce. --- ui/src/components/post-form.tsx | 7 +++--- ui/src/utils.ts | 42 +++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx index 9b33c6e14..54b3ca440 100644 --- a/ui/src/components/post-form.tsx +++ b/ui/src/components/post-form.tsx @@ -4,7 +4,7 @@ import { Subscription } from "rxjs"; import { retryWhen, delay, take } from 'rxjs/operators'; import { PostForm as PostFormI, Post, PostResponse, UserOperation, Community, ListCommunitiesResponse, ListCommunitiesForm, SortType, SearchForm, SearchType, SearchResponse } from '../interfaces'; import { WebSocketService, UserService } from '../services'; -import { msgOp, getPageTitle } from '../utils'; +import { msgOp, getPageTitle, debounce } from '../utils'; import * as autosize from 'autosize'; interface PostFormProps { @@ -87,7 +87,7 @@ export class PostForm extends Component {
- + {this.state.suggestedTitle &&
copy suggested title: {this.state.suggestedTitle}
} @@ -96,7 +96,7 @@ export class PostForm extends Component {
-