grafana/public/app/stores/SearchStore/SearchStore.ts
Johannes Schill 8abef88b94 mobx: poc in using each store as individual prop on the react containers (#10414)
* mobx: poc in using each store as individual prop on the react containers

* prettier test

* fix: end the war between prettier vs tslint.

* mobx: Move stores into their own folders

* mobx: Refactor the AlertRule into its own file and add a helper-file

* mobx: Move NavItem out of NavStore and remove lodash dependancy

* mobx: Move ResultItem and SearchResultSection models out of the SearchStore

* mobx: ServerStatsStore rename .tsx => .ts. And move ServerStat-model to its own file.

* mobx: Remove lodash and jquery dependancy from ViewStore

* mobx: Remove issue with double question mark
2018-01-03 20:11:07 +01:00

23 lines
555 B
TypeScript

import { types } from 'mobx-state-tree';
import { SearchResultSection } from './SearchResultSection';
export const SearchStore = types
.model('SearchStore', {
sections: types.array(SearchResultSection),
})
.actions(self => ({
query() {
for (let i = 0; i < 100; i++) {
self.sections.push(
SearchResultSection.create({
id: 'starred' + i,
title: 'starred',
icon: 'fa fa-fw fa-star-o',
expanded: false,
items: [],
})
);
}
},
}));