Files
mattermost-mobile/app/store/fetching_thread_store.ts
Anurag Shivarathri 724d72d98a [MM-47483] Activity Indicator while loading thread posts (#6865)
* Fix

* Addressing feedback

* Disabled pull to refresh when thread is being fetched

* Test fail fix

* Feedback changes
2022-12-17 01:15:22 +05:30

19 lines
507 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {BehaviorSubject} from 'rxjs';
type State = {[id: string]: boolean};
const defaultState: State = {};
export const subject: BehaviorSubject<State> = new BehaviorSubject(defaultState);
export const setFetchingThreadState = (rootId: string, isFetching: boolean) => {
const prevState = subject.value;
subject.next({
...prevState,
[rootId]: isFetching,
});
};