diff --git a/src/ts/@loafer/context/decorator/App.ts b/src/ts/@loafer/application/decorator/App.ts similarity index 74% rename from src/ts/@loafer/context/decorator/App.ts rename to src/ts/@loafer/application/decorator/App.ts index c864835..905ee6b 100644 --- a/src/ts/@loafer/context/decorator/App.ts +++ b/src/ts/@loafer/application/decorator/App.ts @@ -12,10 +12,10 @@ import { } from '@loafer/core/reflect'; import { - InjectableAnnotation, -} from '@loafer/pouches/decorator/Injectable'; + ConfigurationAnnotation, +} from '@loafer/context/decorator/Configuration'; -export class AppAnnotation extends InjectableAnnotation implements DecoratorHandler { +export class AppAnnotation extends ConfigurationAnnotation implements DecoratorHandler { public constructor(qualifier?: PropertyType) { super(qualifier); } diff --git a/src/ts/@loafer/context/AppContext.ts b/src/ts/@loafer/context/ApplicationContext.ts similarity index 69% rename from src/ts/@loafer/context/AppContext.ts rename to src/ts/@loafer/context/ApplicationContext.ts index 624d0c2..925dbe5 100644 --- a/src/ts/@loafer/context/AppContext.ts +++ b/src/ts/@loafer/context/ApplicationContext.ts @@ -1,8 +1,8 @@ import PouchFactory from '@loafer/pouches/factory/PouchFactory'; import DefaultPouchFactory from '@loafer/pouches/factory/implement/DefaultPouchFactory'; -interface AppContext extends PouchFactory { +interface ApplicationContext extends PouchFactory { getPouchFactory(): DefaultPouchFactory; } -export default AppContext; +export default ApplicationContext; diff --git a/src/ts/@loafer/context/implement/DefaultAppContext.ts b/src/ts/@loafer/context/DefaultAppContext.ts similarity index 85% rename from src/ts/@loafer/context/implement/DefaultAppContext.ts rename to src/ts/@loafer/context/DefaultAppContext.ts index 5bbadad..54d3058 100644 --- a/src/ts/@loafer/context/implement/DefaultAppContext.ts +++ b/src/ts/@loafer/context/DefaultAppContext.ts @@ -3,11 +3,11 @@ import { PropertyType, } from '@loafer/core/constants/types'; -import AppContext from '@loafer/context/AppContext'; +import ApplicationContext from '@loafer/context/ApplicationContext'; import DefaultPouchFactory from '@loafer/pouches/factory/implement/DefaultPouchFactory'; -class DefaultAppContext implements AppContext { +class DefaultAppContext implements ApplicationContext { private readonly pouchFactory: DefaultPouchFactory; public constructor() { diff --git a/src/ts/@loafer/context/annotation/AnnotationConfigApplicationContext.ts b/src/ts/@loafer/context/annotation/AnnotationConfigApplicationContext.ts new file mode 100644 index 0000000..ac62273 --- /dev/null +++ b/src/ts/@loafer/context/annotation/AnnotationConfigApplicationContext.ts @@ -0,0 +1,7 @@ +import GenericApplicationContext from '@loafer/context/support/GenericApplicationContext'; + +export class AnnotationConfigApplicationContext extends GenericApplicationContext { + +} + +export default AnnotationConfigApplicationContext; diff --git a/src/ts/@loafer/context/constants/index.ts b/src/ts/@loafer/context/constants/index.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/ts/@loafer/context/redux/action/lifecycle.ts b/src/ts/@loafer/context/redux/action/lifecycle.ts deleted file mode 100644 index c8f7e66..0000000 --- a/src/ts/@loafer/context/redux/action/lifecycle.ts +++ /dev/null @@ -1,24 +0,0 @@ -import Action from '@overflow/commons/redux/Action'; - -// Action Type -export type INITIALIZED = '@overflow/commons/context/INITIALIZED'; -export type WILL_DESTROY = '@overflow/commons/context/WILL_DESTROY'; - -export const INITIALIZED: INITIALIZED = '@overflow/commons/context/INITIALIZED'; -export const WILL_DESTROY: WILL_DESTROY = '@overflow/commons/context/WILL_DESTROY'; - -// Action Creater -export type initialized = () => Action; -export type willDestroy = () => Action; - -export const initialized: initialized = (): Action => { - return { - type: INITIALIZED, - }; -}; - -export const willDestroy: willDestroy = (): Action => { - return { - type: WILL_DESTROY, - }; -}; diff --git a/src/ts/@loafer/context/redux/saga/index.ts b/src/ts/@loafer/context/redux/saga/index.ts deleted file mode 100644 index bfa201a..0000000 --- a/src/ts/@loafer/context/redux/saga/index.ts +++ /dev/null @@ -1,25 +0,0 @@ - -import { SagaIterator } from 'redux-saga'; -import { call, fork, take } from 'redux-saga/effects'; - -import * as LifecycleActions from '../action/lifecycle'; - -import AppContext from '../../AppContext'; - - -function _destroy(): Promise { - return new Promise(resolve => { - // AppContext.getInstance().destroy(); - resolve(); - }); -} - -function* destroy(): SagaIterator { - yield take(LifecycleActions.WILL_DESTROY); - yield call(_destroy); -} - - -export default function* root(): SagaIterator { - yield fork(destroy); -} diff --git a/src/ts/@loafer/context/support/AbstractApplicationContext.ts b/src/ts/@loafer/context/support/AbstractApplicationContext.ts new file mode 100644 index 0000000..0fc28a3 --- /dev/null +++ b/src/ts/@loafer/context/support/AbstractApplicationContext.ts @@ -0,0 +1,5 @@ +export abstract class AbstractApplicationContext { + +} + +export default AbstractApplicationContext; diff --git a/src/ts/@loafer/context/support/GenericApplicationContext.ts b/src/ts/@loafer/context/support/GenericApplicationContext.ts new file mode 100644 index 0000000..acf0cdd --- /dev/null +++ b/src/ts/@loafer/context/support/GenericApplicationContext.ts @@ -0,0 +1,7 @@ +import AbstractApplicationContext from '@loafer/context/support/AbstractApplicationContext'; + +export class GenericApplicationContext extends AbstractApplicationContext { + +} + +export default GenericApplicationContext; diff --git a/src/ts/@overflow/app/index.tsx b/src/ts/@overflow/app/index.tsx index 8b5bce1..aa760cd 100644 --- a/src/ts/@overflow/app/index.tsx +++ b/src/ts/@overflow/app/index.tsx @@ -44,11 +44,10 @@ import * as injectTapEventPlugin from 'react-tap-event-plugin'; import Application from '@loafer/application/Application'; import ApplicationStater from '@loafer/application/ApplicationStater'; import Platform from '@overflow/commons/platform'; -import App from '@loafer/context/decorator/App'; +import App from '@loafer/application/decorator/App'; import Inject from '@loafer/pouches/decorator/Inject'; import AppContext from '@loafer/context/AppContext'; -import * as AppContextLifecycleActions from '@loafer/context/redux/action/lifecycle'; import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC'; import ReducerContext from '@overflow/commons/redux/ReducerContext'; import { SagaWatcher } from '@overflow/commons/constant'; @@ -103,8 +102,6 @@ class OFApplication implements ApplicationStater { await this.initRedux(); - this.store.dispatch(AppContextLifecycleActions.initialized()); - this.displayApp(); } catch (e) { console.error(e);