Skip to content

Commit

Permalink
feat(cart-store-credit)!: fix copy/paste errors (#2705)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `daffCustomerStoreCredit` -> `daffCartStoreCredit`
  • Loading branch information
griest024 committed Jan 3, 2024
1 parent 8eb5c67 commit 20921d4
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
DaffCartStoreCreditReducerState,
DaffCartStoreCreditStateRootSlice,
} from '../../reducers/public_api';
import { daffCustomerStoreCreditGetSelectors } from '../../selectors/public_api';
import { daffCartStoreCreditGetSelectors } from '../../selectors/public_api';

/**
* @inheritdoc
Expand All @@ -39,7 +39,7 @@ export class DaffCartStoreCreditPageFacade implements DaffCartStoreCreditPageFac
selectLoadingState,
selectMutating,
selectResolving,
} = daffCustomerStoreCreditGetSelectors();
} = daffCartStoreCreditGetSelectors();

this.loadingState$ = this.store.pipe(select(selectLoadingState));
this.loading$ = this.store.pipe(select(selectLoading));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ import { DaffCartStoreCreditReducerState } from './type';
/**
* The initial state for the main cart store credit state, see {@link DaffCartStoreCreditReducerState}.
*/
export const daffCustomerStoreCreditInitialState: DaffCartStoreCreditReducerState = daffOperationInitialState;
export const daffCartStoreCreditInitialState: DaffCartStoreCreditReducerState = daffOperationInitialState;
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { DaffCartStoreCreditReducerState } from './type';
export { daffCustomerStoreCreditInitialState } from './initial-state';
export { daffCustomerStoreCreditReducer } from './reducer';
export { daffCartStoreCreditInitialState } from './initial-state';
export { daffCartStoreCreditReducer } from './reducer';
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TestBed } from '@angular/core/testing';

import { DaffCartWithStoreCredit } from '@daffodil/cart-store-credit';
import {
daffCustomerStoreCreditInitialState as initialState,
daffCartStoreCreditInitialState as initialState,
DaffCartStoreCreditReducerState,
DaffCartStoreCreditApply,
DaffCartStoreCreditApplyFailure,
Expand All @@ -17,9 +17,9 @@ import {
DaffStateError,
} from '@daffodil/core/state';

import { daffCustomerStoreCreditReducer as reducer } from './reducer';
import { daffCartStoreCreditReducer as reducer } from './reducer';

describe('@daffodil/cart-store-credit/state | daffCustomerStoreCreditReducer', () => {
describe('@daffodil/cart-store-credit/state | daffCartStoreCreditReducer', () => {
let storeCreditFactory: DaffCartWithStoreCreditFactory;
let mockStoreCredit: DaffCartWithStoreCredit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
daffStartMutation,
} from '@daffodil/core/state';

import { daffCustomerStoreCreditInitialState } from './initial-state';
import { daffCartStoreCreditInitialState } from './initial-state';
import { DaffCartStoreCreditReducerState } from './type';
import {
DaffCartStoreCreditActions,
Expand All @@ -15,8 +15,8 @@ import {
/**
* The reducer for the cart store credit page state, see {@link DaffCartStoreCreditReducerState}.
*/
export const daffCustomerStoreCreditReducer = <T extends DaffCartWithStoreCredit = DaffCartWithStoreCredit>(
state = daffCustomerStoreCreditInitialState,
export const daffCartStoreCreditReducer = <T extends DaffCartWithStoreCredit = DaffCartWithStoreCredit>(
state = daffCartStoreCreditInitialState,
action: DaffCartStoreCreditActions<T>,
): DaffCartStoreCreditReducerState => {
switch (action.type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { ActionReducer } from '@ngrx/store';
import { DaffCartStoreCreditReducersState } from '@daffodil/cart-store-credit/state';

import {
daffCustomerProvideExtraReducers,
daffCartStoreCreditProvideExtraReducers,
DAFF_CART_STORE_CREDIT_EXTRA_REDUCERS,
} from './extra.token';

describe('@daffodil/cart-store-credit/state | daffCustomerProvideExtraReducers', () => {
describe('@daffodil/cart-store-credit/state | daffCartStoreCreditProvideExtraReducers', () => {
let reducers: ActionReducer<DaffCartStoreCreditReducersState>[];
let result: ActionReducer<DaffCartStoreCreditReducersState>[];

Expand All @@ -20,7 +20,7 @@ describe('@daffodil/cart-store-credit/state | daffCustomerProvideExtraReducers',

TestBed.configureTestingModule({
providers: [
...daffCustomerProvideExtraReducers(...reducers),
...daffCartStoreCreditProvideExtraReducers(...reducers),
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { DaffCartStoreCreditReducersState } from '../reducers.interface';
/**
* A token to hold the injectable extra reducers.
*
* Prefer using {@link daffCustomerProvideExtraReducers}.
* Prefer using {@link daffCartStoreCreditProvideExtraReducers}.
*/
export const DAFF_CART_STORE_CREDIT_EXTRA_REDUCERS = new InjectionToken<ActionReducer<DaffCartStoreCreditReducersState>[]>(
'DAFF_CART_STORE_CREDIT_EXTRA_REDUCERS',
Expand All @@ -24,14 +24,14 @@ export const DAFF_CART_STORE_CREDIT_EXTRA_REDUCERS = new InjectionToken<ActionRe
*
* ```ts
* providers: [
* ...daffCustomerProvideExtraReducers(
* ...daffCartStoreCreditProvideExtraReducers(
* myReducer1,
* myReducer2
* )
* ]
* ```
*/
export function daffCustomerProvideExtraReducers(
export function daffCartStoreCreditProvideExtraReducers(
...reducers: ActionReducer<DaffCartStoreCreditReducersState>[]
): Provider[] {
return reducers.map(reducer => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {
daffCustomerProvideExtraReducers,
daffCartStoreCreditProvideExtraReducers,
DAFF_CART_STORE_CREDIT_EXTRA_REDUCERS,
} from './extra.token';
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { TestBed } from '@angular/core/testing';
import { ActionReducer } from '@ngrx/store';

import {
daffCustomerProvideExtraReducers,
daffCartStoreCreditProvideExtraReducers,
DaffCartStoreCreditReducersState,
daffCustomerStoreCreditInitialState,
daffCartStoreCreditInitialState,
DaffCartStoreCreditApplyFailure,
} from '@daffodil/cart-store-credit/state';
import { DaffStateError } from '@daffodil/core/state';

import { DAFF_CART_STORE_CREDIT_REDUCERS } from './reducers.token';

describe('@daffodil/cart-store-credit/state | daffCustomerProvideExtraReducers', () => {
describe('@daffodil/cart-store-credit/state | daffCartStoreCreditProvideExtraReducers', () => {
let extraError: DaffStateError;

let extraReducer: ActionReducer<DaffCartStoreCreditReducersState>;
Expand All @@ -21,7 +21,7 @@ describe('@daffodil/cart-store-credit/state | daffCustomerProvideExtraReducers',
beforeEach(() => {
const initialState: DaffCartStoreCreditReducersState = {
storeCredit: {
...daffCustomerStoreCreditInitialState,
...daffCartStoreCreditInitialState,
daffErrors: [{
code: 'code',
message: 'already in state',
Expand All @@ -45,7 +45,7 @@ describe('@daffodil/cart-store-credit/state | daffCustomerProvideExtraReducers',

TestBed.configureTestingModule({
providers: [
...daffCustomerProvideExtraReducers(extraReducer),
...daffCartStoreCreditProvideExtraReducers(extraReducer),
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { daffComposeReducers } from '@daffodil/core/state';

import { DAFF_CART_STORE_CREDIT_EXTRA_REDUCERS } from './extra.token';
import { DaffCartStoreCreditReducersState } from '../reducers.interface';
import { daffCustomerStoreCreditReducer } from '../store-credit/public_api';
import { daffCartStoreCreditReducer } from '../store-credit/public_api';

/**
* An internal token to hold the Daffodil cart reducers.
Expand All @@ -27,7 +27,7 @@ export const DAFF_CART_STORE_CREDIT_REDUCERS = new InjectionToken<ActionReducer<
providedIn: 'any',
factory: () => daffComposeReducers([
combineReducers({
storeCredit: daffCustomerStoreCreditReducer,
storeCredit: daffCartStoreCreditReducer,
}),
...inject(DAFF_CART_STORE_CREDIT_EXTRA_REDUCERS),
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type DaffCartStoreCreditSelectors = DaffOperationStateSelectors<DaffCartS
/**
* Creates a group of selectors for {@link DaffCartStoreCreditReducerState} that use the passed state selector as the basis.
*/
const daffCustomerStoreCreditCreateSelectors = (): DaffCartStoreCreditSelectors => {
const daffCartStoreCreditCreateSelectors = (): DaffCartStoreCreditSelectors => {
const { selectCustomerStoreCreditFeatureState } = getDaffCartStoreCreditReducersStateSelector();
const selectCustomerStoreCreditState = createSelector(
selectCustomerStoreCreditFeatureState,
Expand All @@ -29,9 +29,9 @@ const daffCustomerStoreCreditCreateSelectors = (): DaffCartStoreCreditSelectors
return daffOperationStateSelectorFactory(selectCustomerStoreCreditState);
};

export const daffCustomerStoreCreditGetSelectors = (() => {
export const daffCartStoreCreditGetSelectors = (() => {
let cache;
return (): DaffCartStoreCreditSelectors =>
cache = cache || daffCustomerStoreCreditCreateSelectors();
cache = cache || daffCartStoreCreditCreateSelectors();
})();

0 comments on commit 20921d4

Please sign in to comment.