How to use the @datorama/akita.StoreConfig function in @datorama/akita

To help you get started, we’ve selected a few @datorama/akita examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github datorama / akita / angular / playground / src / app / widgets / state / widgets.store.ts View on Github external
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);
  }
}
github datorama / akita / examples / akita-angular-server-side-pagination / src / app / contacts / state / contacts.store.ts View on Github external
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();
  }
}
github datorama / akita / angular / playground / src / app / contacts / state / contacts.store.ts View on Github external
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();
  }
}
github dockstore / dockstore-ui2 / src / app / entry / entry-file-tab / state / entry-file-tab.store.ts View on Github external
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());
  }
}
github dockstore / dockstore-ui2 / src / app / workflow / files / state / files.store.ts View on Github external
*        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({});
  }
}
github datorama / akita / angular / playground / src / app / auth / state / auth.store.ts View on Github external
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());
  }
}
github tanepiper / ngx-tinynodes / libs / ngx-editorjs / ngx-editorjs-demo / src / lib / store / pages / pages.store.ts View on Github external
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();
  }
}
github datorama / akita / angular / playground / src / app / stories / state / stories.store.ts View on Github external
};
}

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);
  }
}
github datorama / akita / angular / playground / projects / ng-forms-manager / src / lib / forms-manager.store.ts View on Github external
import { Store, StoreConfig } from '@datorama/akita';

@StoreConfig({
  name: 'formsManager'
})
export class FormsStore extends Store {
  constructor(state: T) {
    super(state);
  }
}
github dockstore / dockstore-ui2 / src / app / organizations / state / organizations.store.ts View on Github external
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());
  }
}