Skip to content

Commit

Permalink
fix: plugins no init
Browse files Browse the repository at this point in the history
  • Loading branch information
taixw2 committed Sep 29, 2020
1 parent 7c948fb commit 462ae0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/dx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CreateOption } from '@dxjs/shared/interfaces/dx-create-option.interface
import { Store, Action } from 'redux';
import * as React from 'react';
import { DxModelContstructor } from '@dxjs/shared/interfaces/dx-model.interface';
import { changeDxInstance } from '../helper/store';
import { changeDxInstance, store } from '../helper/store';

export interface DxFactoryInterface {
createStore: <T>(options?: CreateOption<T>) => Store<{}, Action>;
Expand All @@ -25,7 +25,11 @@ export interface DxFactoryInterface {
export function DxFactory(): DxFactoryInterface {
const inst = Symbol('__dx');

// init
changeDxInstance(inst);
if (store.plugins.size === 0) {
store.plugins = new Map();
}

return {
createStore: createStoreFactory(),
Expand Down

0 comments on commit 462ae0a

Please sign in to comment.