Skip to content

Commit b48a51d

Browse files
committed
docs: replace js files with ts files
1 parent ca527d3 commit b48a51d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/tutorials/quick-start.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ npm install @reduxjs/toolkit angular-redux
4545

4646
### Create a Redux Store
4747

48-
Create a file named `src/app/store.js`. Import the `configureStore` API from Redux Toolkit. We'll start by creating an empty Redux store, and exporting it:
48+
Create a file named `src/app/store.ts`. Import the `configureStore` API from Redux Toolkit. We'll start by creating an empty Redux store, and exporting it:
4949

50-
```typescript title="app/store.js"
50+
```typescript title="app/store.ts"
5151
import { configureStore } from '@reduxjs/toolkit'
5252

5353
export default configureStore({
@@ -80,13 +80,13 @@ bootstrapApplication(AppComponent, {
8080

8181
### Create a Redux State Slice
8282

83-
Add a new file named `src/features/counter/counterSlice.js`. In that file, import the `createSlice` API from Redux Toolkit.
83+
Add a new file named `src/features/counter/counterSlice.ts`. In that file, import the `createSlice` API from Redux Toolkit.
8484

8585
Creating a slice requires a string name to identify the slice, an initial state value, and one or more reducer functions to define how the state can be updated. Once a slice is created, we can export the generated Redux action creators and the reducer function for the whole slice.
8686

8787
Redux requires that [we write all state updates immutably, by making copies of data and updating the copies](https://redux.js.org/tutorials/fundamentals/part-2-concepts-data-flow#immutability). However, Redux Toolkit's `createSlice` and `createReducer` APIs use [Immer](https://immerjs.github.io/immer/) inside to allow us to [write "mutating" update logic that becomes correct immutable updates](https://redux.js.org/tutorials/fundamentals/part-8-modern-redux#immutable-updates-with-immer).
8888

89-
```js title="features/counter/counterSlice.js"
89+
```js title="features/counter/counterSlice.ts"
9090
import { createSlice } from '@reduxjs/toolkit'
9191

9292
export const counterSlice = createSlice({
@@ -122,7 +122,7 @@ export default counterSlice.reducer
122122

123123
Next, we need to import the reducer function from the counter slice and add it to our store. By defining a field inside the `reducer` parameter, we tell the store to use this slice reducer function to handle all updates to that state.
124124

125-
```js title="app/store.js"
125+
```js title="app/store.ts"
126126
import { configureStore } from '@reduxjs/toolkit'
127127
// highlight-next-line
128128
import counterReducer from '../features/counter/counterSlice'

0 commit comments

Comments
 (0)