This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { QueryEntity } from '@datorama/akita'; | |
import { ListStore, ListsState } from './shopika.store'; | |
import { List, Item } from './shopika.model'; | |
export class ListQuery extends QueryEntity<ListsState, List> { | |
constructor(protected store: ListStore) { | |
super(store); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { EntityState, EntityStore, StoreConfig, getInitialActiveState, ActiveState } from '@datorama/akita'; | |
import { List } from './shopika.model'; | |
export interface ListsState extends EntityState<List>, ActiveState { } | |
@StoreConfig({ name: 'lists' }) | |
export class ListStore extends EntityStore<ListsState, List> { | |
constructor() { | |
super(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './polyfills'; | |
import { enableProdMode } from '@angular/core'; | |
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |
import { AppModule } from './app/app.module'; | |
import { enableAkitaProdMode, persistState } from '@datorama/akita'; | |
enableAkitaProdMode(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { List, Item, ShopikaService } from '../state'; | |
export class AddListComponent { | |
list: List; | |
constructor(private shopikaService: ShopikaService) { } | |
saveList() { | |
this.shopikaService.addList(this.list); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ID } from '@datorama/akita'; | |
export interface List { | |
id: ID; | |
name: string; | |
date: number | Date; | |
items: Item[]; | |
} | |
export interface Item { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface EntityState<E> { | |
entities: HashMap<E>; | |
ids: ID[]; | |
loading: boolean; | |
error: any; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
selectAll(options: { | |
asObject: true; | |
filterBy?: SelectOptions<E>['filterBy']; | |
limitTo?: number; | |
sortBy?: undefined; | |
sortByOrder?: undefined; | |
}): Observable<HashMap<E>>; | |
selectAll(options: { | |
filterBy: SelectOptions<E>['filterBy']; | |
limitTo?: number; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const socketio = require("socket.io"); | |
const _ = require("lodash"); | |
const actions = require("./actions"); | |
const port = process.env.PORT || 5000; | |
const env = process.env.NODE_ENV || "development"; | |
const app = express(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var smpp = require('smpp'); | |
var session = smpp.connect('smpp://SEVER_IP'); | |
var request = require('request'); | |
var connected = false; | |
session.on('connect', function () { | |
connected = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @license | |
* Copyright Datorama. All Rights Reserved. | |
* | |
* Use of this source code is governed by an Apache License 2.0 license that can be | |
* found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE | |
*/ | |
import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; | |
import { FormControl, FormGroup } from '@angular/forms'; |