Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Injectable } from '@angular/core';
import { Widget } from './widget.model';
import { EntityState, EntityStore, StoreConfig, MultiActiveState } from '@datorama/akita';
export interface WidgetsState extends EntityState, MultiActiveState {
name: string;
}
const initState = {
name: 'Akita widgets',
active: []
};
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'widgets' })
export class WidgetsStore extends EntityStore {
constructor() {
super(initState);
}
}
import { Injectable } from '@angular/core';
import { EntityState, EntityStore, StoreConfig } from '@datorama/akita';
import { Contact } from './contact.model';
export interface ContactsState extends EntityState {}
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'contacts' })
export class ContactsStore extends EntityStore {
constructor() {
super();
}
}
import { Injectable } from '@angular/core';
import { Contact } from './contact.model';
import { EntityState, EntityStore, StoreConfig } from '@datorama/akita';
export interface ContactState extends EntityState {}
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'contacts' })
export class ContactsStore extends EntityStore {
constructor() {
super();
}
}
export function createInitialState(): EntryFileTabState {
return {
unfilteredFiles: null,
fileTypes: null,
selectedFileType: null,
files: null,
selectedFile: null,
fileContents: null,
downloadFilePath: null,
validationMessage: null
};
}
@Injectable()
@StoreConfig({ name: 'entry-file-tab' })
export class EntryFileTabStore extends Store {
constructor() {
super(createInitialState());
}
}
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Injectable } from '@angular/core';
import { EntityState, EntityStore, StoreConfig } from '@datorama/akita';
import { FileWrapper } from '../../../shared/swagger';
export interface FilesState extends EntityState {}
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'files' })
export class FilesStore extends EntityStore {
constructor() {
super({});
}
}
firstName: string;
lastName: string;
token: string;
}
export function createInitialState(): AuthState {
return {
id: null,
firstName: '',
lastName: '',
token: ''
};
}
@Injectable({ providedIn: 'root' })
@StoreConfig({
name: 'auth',
resettable: true
})
export class AuthStore extends Store {
constructor() {
super(createInitialState());
}
}
import { Injectable } from '@angular/core';
import { EntityState, EntityStore, StoreConfig } from '@datorama/akita';
import { Page } from './pages.models';
export interface PagesState extends EntityState {}
@Injectable()
@StoreConfig({ name: 'pages' })
export class PagesStore extends EntityStore {
constructor() {
super();
}
}
};
}
const initialState: StoriesState = {
loading: false,
someBoolean: true,
skills: ['JS'],
config: {
time: '',
tankOwners: ['one', 'two '],
isAdmin: false
}
};
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'stories' })
export class StoriesStore extends EntityStore {
constructor() {
super(initialState);
}
}
import { Store, StoreConfig } from '@datorama/akita';
@StoreConfig({
name: 'formsManager'
})
export class FormsStore extends Store {
constructor(state: T) {
super(state);
}
}
import { Organization } from '../../shared/swagger';
export interface OrganizationsState {
organizations: Array;
searchName: string;
}
export function createInitialState(): OrganizationsState {
return {
organizations: null,
searchName: ''
};
}
@Injectable({ providedIn: 'root' })
@StoreConfig({ name: 'organizations' })
export class OrganizationsStore extends Store {
constructor() {
super(createInitialState());
}
}