當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript mobx.configure函數代碼示例

本文整理匯總了TypeScript中mobx.configure函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript configure函數的具體用法?TypeScript configure怎麽用?TypeScript configure使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了configure函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: configure

import { store } from './store'
import { configure } from 'mobx'
import { regras } from './dbRegras'
import { pragas } from './dbPragas'
import { hospedeiros } from './dbHospedeiros'
import './utils'
import * as d3 from 'd3-array'
import 'jest'

configure({ enforceActions: 'observed' }) //useStrict(true)

const estadosSemAC = [
  { estado: '', UF: '' },
  //{estado: 'Acre', UF: 'AC'},

  { estado: 'Alagoas', UF: 'AL' },
  { estado: 'Amazonas', UF: 'AM' },
  { estado: 'Amapá', UF: 'AP' },
  { estado: 'Bahia', UF: 'BA' },
  { estado: 'Ceará', UF: 'CE' },
  { estado: 'Distrito Federal', UF: 'DF' },
  { estado: 'Espirito Santo', UF: 'ES' },
  { estado: 'Goiás', UF: 'GO' },
  { estado: 'Maranhão', UF: 'MA' },
  { estado: 'Minas Gerais', UF: 'MG' },
  { estado: 'Mato Grosso do Sul', UF: 'MS' },
  { estado: 'Mato Grosso', UF: 'MT' },
  { estado: 'Pará', UF: 'PA' },
  { estado: 'Paraíba', UF: 'PB' },
  { estado: 'Pernambuco', UF: 'PE' },
  { estado: 'Piauí', UF: 'PI' },
開發者ID:cefiti,項目名稱:cefiti,代碼行數:31,代碼來源:store.test.ts

示例2: configure

import { DateValue, format_date } from '../src/model';
import { configure, action } from 'mobx';

configure({
  enforceActions: 'always'
});

it('date-value round to full day constructor', () => {
  const n = new DateValue(new Date('2018-09-04 17:01:02'), 'what');
  expect(n.date.get()).toEqual(new Date('2018-09-04'));
  expect(n.formatDate.get()).toEqual(format_date(new Date('2018-09-04')));
});

it('date-value round to full day date', () => {
  const n = new DateValue(new Date('2018-07-04 17:01:02'), 'what');
  action(() => n.date.set(new Date('2018-09-04 17:01:02')))();
  expect(n.date.get()).toEqual(new Date('2018-09-04'));
  expect(n.formatDate.get()).toEqual(format_date(new Date('2018-09-04')));
});

it('date-value round to full day format_date', () => {
  const n = new DateValue(new Date('2018-07-04 17:01:02'), 'what');
  action(() => n.formatDate.set('2018-09-04'))();
  expect(n.date.get()).toEqual(new Date('2018-09-04'));
  expect(n.formatDate.get()).toEqual(format_date(new Date('2018-09-04')));
});

it('date-value round to full day fill', () => {
  const n = new DateValue(new Date('2018-09-04 17:01:02'), 'what');
  expect(n.toObj()).toEqual({
    formatDate: '2018-09-04',
開發者ID:mabels,項目名稱:clavator,代碼行數:31,代碼來源:date-value.test.ts

示例3: require

require("app-module-path").addPath(__dirname + "/..");

import { app, BrowserWindow } from "electron";
import { configure } from "mobx";

import { setup } from "setup/setup";

import * as HomeWindowModule from "main/home-window";
import * as SettingsModule from "main/settings";
import { openFile } from "main/project-editor-window";

configure({ enforceActions: "observed" });

////////////////////////////////////////////////////////////////////////////////

let setupFinished: boolean = false;
let projectFilePath: string | undefined;

app.on("ready", async function() {
    // make sure there is only one instance of this application
    // var gotTheLock = app.requestSingleInstanceLock();
    // if (!gotTheLock) {
    //     app.quit();
    //     return;
    // }
    app.on("second-instance", function(event, commandLine, workingDirectory) {
        const projectFilePath = commandLine[commandLine.length - 1];
        if (projectFilePath.toLowerCase().endsWith(".eez-project")) {
            openFile(projectFilePath);
        } else {
            const {
開發者ID:eez-open,項目名稱:studio,代碼行數:31,代碼來源:main.ts

示例4: useStrict

export default function useStrict(strictMode: boolean) {
    configure({ enforceActions: strictMode ? 'observed' : 'never' });
}
開發者ID:Microsoft,項目名稱:satcheljs,代碼行數:3,代碼來源:useStrict.ts

示例5: configure

import { configure } from 'mobx';
import DashBoardStore from './routes/dashboard/dashboard.store';
import LoginStore from './routes/login/login.store';
import UserStore from './routes/user/user.store';
import PostStore from './routes/post/post.store';
import SharedStore from './shared.store';
import CategoryStore from './routes/category/category.store';
import PushStore from './routes/push/push.store';
import PageStore from './routes/page/page.store';
import ArticleStore from './components/article/article.store';
import AppearanceStore from './routes/appearance/appearance.store';
import OptionsStore from './routes/options/options.store';

configure({
    enforceActions: 'never'
});

export class AppStore {

    dashBoardStore: DashBoardStore;
    loginStore: LoginStore;
    userStore: UserStore;
    postStore: PostStore;
    categoryStore: CategoryStore;
    sharedStore: SharedStore;
    pushStore: PushStore;
    pageStore: PageStore;
    articleStore: ArticleStore;

    constructor() {
        this.sharedStore = new SharedStore();
開發者ID:75team,項目名稱:firekylin,代碼行數:31,代碼來源:app.store.ts

示例6: configure

import { configure } from 'mobx';
import Store from './Stores/Store';
import ChromeExtensionStorage from './StorageProviders/ChromeExtensionStorage';
import { parse } from 'url';
import { action } from 'mobx/lib/api/action';
configure({
    enforceActions: true
});
const manifest = chrome.runtime.getManifest();
const clipboardholder: HTMLInputElement = document.getElementById('clipboard') as HTMLInputElement;


chrome.runtime.onInstalled.addListener(function (details) {
    if (details.reason == "install") {
        chrome.tabs.create({
            url: "settings.html"
        });
    }
    if (details.reason == "update") {

        var notificationOptions = {
            type: 'basic',
            title: manifest.name,
            message: manifest.name + ' been updated to version: "' + manifest.version + '".',
            iconUrl: "icons/icon48.png",
            isClickable: false
        }

        chrome.notifications.create(null, notificationOptions);
    }
});
開發者ID:Riuujin,項目名稱:get-file-path-chrome-extension,代碼行數:31,代碼來源:background.ts


注:本文中的mobx.configure函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。