Skip to content

Commit 8b0347c

Browse files
committed
Enable strict mode
1 parent 5859e55 commit 8b0347c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/app/about/about-store.service.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,16 @@ import { action, observable } from 'mobx-angular';
55
providedIn: 'root',
66
})
77
export class AboutStoreService {
8-
@observable title = 'about:hello world';
8+
@observable title: string;
9+
10+
constructor() {
11+
this.initialize();
12+
}
13+
14+
@action
15+
private initialize() {
16+
this.title = 'about:hello world';
17+
}
918

1019
@action
1120
randomTitle() {

src/app/app.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NgReduxRouter, routerReducer } from '@angular-redux/router';
22
import { DevToolsExtension, NgRedux } from '@angular-redux/store';
33
import { Component } from '@angular/core';
4+
import { configure } from 'mobx';
45
import { combineReducers } from 'redux';
56
import thunk from 'redux-thunk';
67

@@ -30,6 +31,7 @@ export class AppComponent {
3031
this.devTools.isEnabled() ? [this.devTools.enhancer()] : undefined,
3132
);
3233
this.ngReduxRouter.initialize();
34+
configure({ enforceActions: 'strict' });
3335
}
3436

3537
createReducer(ReducerService) {

0 commit comments

Comments
 (0)