forked from Ivasoft/mattermost-mobile
* Fix * Addressing feedback * Disabled pull to refresh when thread is being fetched * Test fail fix * Feedback changes
19 lines
507 B
TypeScript
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,
|
|
});
|
|
};
|