|
@@ -2,23 +2,20 @@ import {createStore, StoreDefinition} from 'reflux';
|
|
|
|
|
|
import {Repository} from 'sentry/types';
|
|
|
|
|
|
+type State = {
|
|
|
+ orgSlug?: string;
|
|
|
+ repositories?: Repository[];
|
|
|
+ repositoriesError?: Error;
|
|
|
+ repositoriesLoading?: boolean;
|
|
|
+};
|
|
|
+
|
|
|
interface RepositoryStoreDefinition extends StoreDefinition {
|
|
|
- get(): {
|
|
|
- orgSlug?: string;
|
|
|
- repositories?: Repository[];
|
|
|
- repositoriesError?: Error;
|
|
|
- repositoriesLoading?: boolean;
|
|
|
- };
|
|
|
+ get(): State;
|
|
|
loadRepositories(orgSlug: string): void;
|
|
|
loadRepositoriesError(error: Error): void;
|
|
|
loadRepositoriesSuccess(data: Repository[]): void;
|
|
|
resetRepositories(): void;
|
|
|
- state: {
|
|
|
- orgSlug?: string;
|
|
|
- repositories?: Repository[];
|
|
|
- repositoriesError?: Error;
|
|
|
- repositoriesLoading?: boolean;
|
|
|
- };
|
|
|
+ state: State;
|
|
|
}
|
|
|
|
|
|
const storeConfig: RepositoryStoreDefinition = {
|