Skip to content

style(store): remove prettier overrides #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/store/.prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions packages/store/.prettierrc

This file was deleted.

18 changes: 9 additions & 9 deletions packages/store/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ You can now create an encapsulated 'sub-store' that only operates on a section o
```typescript
const subStore = ngRedux.configureSubStore(
['path', 'to', 'somewhere'],
localReducer
localReducer,
);
```

Expand Down Expand Up @@ -210,7 +210,7 @@ export class AnimalActions {
@dispatch()
loadAnimals = (animalType: AnimalType): Action => ({
type: AnimalActions.LOAD_ANIMALS,
meta: { animalType }
meta: { animalType },
});

// ...
Expand Down Expand Up @@ -356,7 +356,7 @@ import { NgReduxModule } from 'ng2-redux';
declarations: [AppComponent],
imports: [NgReduxModule.forRoot(), BrowserModule],
providers: [],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
class AppModule {
// etc.
Expand All @@ -374,7 +374,7 @@ import { NgReduxModule } from 'ng2-redux';
declarations: [AppComponent],
imports: [NgReduxModule, BrowserModule],
providers: [],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
class AppModule {
// etc.
Expand Down Expand Up @@ -439,7 +439,7 @@ import { rootReducer } from './store';
declarations: [AppComponent],
imports: [NgReduxModule, BrowserModule],
providers: [],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
export class AppModule {
constructor(ngRedux: NgRedux<IAppState>) {
Expand Down Expand Up @@ -566,20 +566,20 @@ import {
Store,
combineReducers,
compose,
createStore
createStore,
} from 'redux';
import thunk from 'redux-thunk';
import reduxLogger from 'redux-logger';

import { myReducer } from './reducers/my-reducer';

const rootReducer = combineReducers({
myReducer
myReducer,
});

export const store = createStore(
rootReducer,
compose(applyMiddleware(thunk, reduxLogger))
compose(applyMiddleware(thunk, reduxLogger)),
) as Store;
```

Expand Down Expand Up @@ -681,7 +681,7 @@ const middleware = [createLogger()];
const enhancers = [persistState('counter', { key: 'example-app' })];
const store = compose(
applyMiddleware(middleware),
...enhancers
...enhancers,
)(createStore)(rootReducer);

bootstrap(App, [provide(store)]);
Expand Down
6 changes: 3 additions & 3 deletions packages/store/articles/action-creator-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { RandomNumberService } from '../services/random-number';
export class CounterActions {
constructor(
private ngRedux: NgRedux<RootState>,
private randomNumberService: RandomNumberService
private randomNumberService: RandomNumberService,
) {}

static INCREMENT_COUNTER: string = 'INCREMENT_COUNTER';
Expand Down Expand Up @@ -58,7 +58,7 @@ export class CounterActions {
randomize(): void {
this.ngRedux.dispatch({
type: CounterActions.RANDOMIZE_COUNTER,
payload: this.randomNumberService.pick()
payload: this.randomNumberService.pick(),
});
}
}
Expand All @@ -85,7 +85,7 @@ import { RandomNumberService } from '../services/random-number';
<button (click)="actions.incrementAsync(2222)">Increment async</button>
<button (click)="actions.randomize()">Set to random number</button>
</p>
`
`,
})
export class Counter {
@select('counter') counter$: any;
Expand Down
6 changes: 3 additions & 3 deletions packages/store/articles/di-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ import { LogRemoteName } from './middleware/log-remote-name';
/* ... */
imports: [, /* ... */ NgReduxModule],
providers: [
LogRemoteName
LogRemoteName,
/* ... */
]
],
})
export class AppModule {
constructor(
private ngRedux: NgRedux<IAppState>,
logRemoteName: LogRemoteName
logRemoteName: LogRemoteName,
) {
const middleware = [reduxLogger, logRemoteName.middleware];
this.ngRedux.configureStore(rootReducer, {}, middleware);
Expand Down
14 changes: 7 additions & 7 deletions packages/store/articles/epics.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class SessionActions {
loginUser(credentials) {
this.ngRedux.dispatch({
type: SessionActions.LOGIN_USER,
payload: credentials
payload: credentials,
});
}

Expand Down Expand Up @@ -65,12 +65,12 @@ export class SessionEpics {
.post(`${BASE_URL}/auth/login`, payload)
.map(result => ({
type: SessionActions.LOGIN_USER_SUCCESS,
payload: result.json().meta
payload: result.json().meta,
}))
.catch(error =>
Observable.of({
type: SessionActions.LOGIN_USER_ERROR
})
type: SessionActions.LOGIN_USER_ERROR,
}),
);
});
};
Expand All @@ -96,14 +96,14 @@ import { SessionEpics } from './epics';
/* ... */
imports: [, /* ... */ NgReduxModule],
providers: [
SessionEpics
SessionEpics,
/* ... */
]
],
})
export class AppModule {
constructor(
private ngRedux: NgRedux<IAppState>,
private epics: SessionEpics
private epics: SessionEpics,
) {
const middleware = [createEpicMiddleware(this.epics.login)];
ngRedux.configureStore(rootReducer, {}, middleware);
Expand Down
8 changes: 4 additions & 4 deletions packages/store/articles/fractal-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const userComponentReducer = (state, action) =>
<p>occupation: {{ occupation$ | async }}</p>
<p>lines of code: {{ loc$ | async }}</p>
   <button (click)=addCode(100)>Add 100 lines of code</button>
`
`,
})
export class UserComponent implements NgOnInit {
@Input() userId: String;
Expand All @@ -68,7 +68,7 @@ export class UserComponent implements NgOnInit {
// in the top-level store.
this.subStore = this.ngRedux.configureSubStore(
['users', userId],
userComponentReducer
userComponentReducer,
);

// Substore selectons are scoped to the base path used to configure
Expand Down Expand Up @@ -129,11 +129,11 @@ export const defaultToZero = (obs$: Observable<number>) =>
<p>occupation: {{ occupation$ | async }}</p>
<p>lines of code: {{ loc$ | async }}</p>
   <button (click)=addCode(100)>Add 100 lines of code</button>
`
`,
})
@WithSubStore({
basePathMethodName: 'getBasePath',
localReducer: userComponentReducer
localReducer: userComponentReducer,
})
export class UserComponent implements NgOnInit {
@Input() userId: String;
Expand Down
6 changes: 3 additions & 3 deletions packages/store/articles/immutable-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ can no longer easily dereference properties:

```typescript
const mutableFoo = {
foo: 1
foo: 1,
};

const foo: number = mutableFoo.foo;
Expand Down Expand Up @@ -89,8 +89,8 @@ Immutable.Map<string, any>({
totalCount: 0,
counts: Immutable.map<string, number>({
firstCount: 0,
secondCount: 0
})
secondCount: 0,
}),
});
```

Expand Down
28 changes: 14 additions & 14 deletions packages/store/articles/intro-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ import { AppComponent } from './app.component';
BrowserModule,
FormsModule,
HttpModule,
NgReduxModule // <- New
NgReduxModule, // <- New
],
providers: [],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
export class AppModule {}
```
Expand Down Expand Up @@ -89,7 +89,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'app works!';
Expand Down Expand Up @@ -151,7 +151,7 @@ const nextValueOfCount = streamOfActions.reduce(

return state;
},
{ count: 0 }
{ count: 0 },
);
```

Expand Down Expand Up @@ -192,7 +192,7 @@ export interface IAppState {
}

export const INITIAL_STATE: IAppState = {
count: 0
count: 0,
};

export function rootReducer(lastState: IAppState, action: Action): IAppState {
Expand Down Expand Up @@ -230,7 +230,7 @@ import { CounterActions } from './app.actions'; // <- New
declarations: [AppComponent],
imports: [BrowserModule, FormsModule, HttpModule, NgReduxModule],
providers: [CounterActions], // <- New
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
export class AppModule {
constructor(ngRedux: NgRedux<IAppState>) {
Expand Down Expand Up @@ -273,7 +273,7 @@ ends up looking conceptually a bit like this:
// Pseudocode
const finalAppState: IAppState = actionsOverTime.reduce(
rootReducer,
INITIAL_STATE
INITIAL_STATE,
);
```

Expand Down Expand Up @@ -306,7 +306,7 @@ import { IAppState } from '../store'; // <- New
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'app works!';
Expand All @@ -315,7 +315,7 @@ export class AppComponent {
constructor(
// <- New
private ngRedux: NgRedux<IAppState>, // <- New
private actions: CounterActions
private actions: CounterActions,
) {} // <- New

increment() {
Expand Down Expand Up @@ -350,7 +350,7 @@ export class AppComponent implements OnDestroy {

constructor(
private ngRedux: NgRedux<IAppState>,
private actions: CounterActions
private actions: CounterActions,
) {
this.subscription = ngRedux
.select<number>('count') // <- New
Expand Down Expand Up @@ -447,15 +447,15 @@ import { Observable } from 'rxjs/Observable';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrls: ['./app.component.css'],
})
export class AppComponent {
title = 'app works!';
@select() readonly count$: Observable<number>; // <- Changed

constructor(
private actions: CounterActions,
private ngRedux: NgRedux<IAppState>
private ngRedux: NgRedux<IAppState>,
) {} // <- Changed

increment() {
Expand Down Expand Up @@ -590,7 +590,7 @@ Then, make a quick adjustment to enable them in your app:
import {
NgReduxModule,
NgRedux,
DevToolsExtension
DevToolsExtension,
} from '@angular-redux/store'; // <- Changed

@NgModule({
Expand All @@ -608,7 +608,7 @@ export class AppModule {
rootReducer,
INITIAL_STATE,
[], // <- New
storeEnhancers
storeEnhancers,
); // <- New
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/store/articles/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface IAppState {

@NgModule({
/* ... */
imports: [, /* ... */ NgReduxModule]
imports: [, /* ... */ NgReduxModule],
})
export class AppModule {
constructor(ngRedux: NgRedux<IAppState>) {
Expand All @@ -50,7 +50,7 @@ import {
Store,
combineReducers,
compose,
createStore
createStore,
} from 'redux';
import { NgReduxModule, NgRedux } from '@angular-redux/store';
import { createLogger } from 'redux-logger';
Expand All @@ -62,12 +62,12 @@ interface IAppState {

export const store: Store<IAppState> = createStore(
rootReducer,
applyMiddleware(createLogger())
applyMiddleware(createLogger()),
);

@NgModule({
/* ... */
imports: [, /* ... */ NgReduxModule]
imports: [, /* ... */ NgReduxModule],
})
class AppModule {
constructor(ngRedux: NgRedux<IAppState>) {
Expand All @@ -92,7 +92,7 @@ import { select } from '@angular-redux/store';

@Component({
template:
'<button (click)="onClick()">Clicked {{ count | async }} times</button>'
'<button (click)="onClick()">Clicked {{ count | async }} times</button>',
})
class App {
@select() count$: Observable<number>;
Expand Down
Loading