Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitde4c846

Browse files
committed
refactor: use global usings
1 parentd9e8ded commitde4c846

File tree

87 files changed

+4592
-4817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+4592
-4817
lines changed

‎ReduxSimple.DevTools/Actions.cs‎

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
1-
usingSystem.Collections.Immutable;
1+
namespaceReduxSimple.DevTools;
22

3-
namespaceReduxSimple.DevTools
3+
/// <summary>
4+
/// Action dispatched when the state history is updated (list of action/state updates).
5+
/// </summary>
6+
publicclassHistoryUpdated
47
{
5-
/// <summary>
6-
/// Action dispatched when the state history is updated (list of action/state updates).
7-
/// </summary>
8-
publicclassHistoryUpdated
9-
{
10-
publicImmutableList<ReduxActionInfo>?CurrentActions{get;set;}
11-
publicImmutableList<ReduxActionInfo>?FutureActions{get;set;}
12-
}
8+
publicImmutableList<ReduxActionInfo>?CurrentActions{get;set;}
9+
publicImmutableList<ReduxActionInfo>?FutureActions{get;set;}
10+
}
1311

14-
/// <summary>
15-
/// Action dispatched when the user moves the store to a given position (with undo/redo mechanism).
16-
/// </summary>
17-
publicclassMoveToPositionAction
18-
{
19-
publicint?Position{get;set;}
20-
}
12+
/// <summary>
13+
/// Action dispatched when the user moves the store to a given position (with undo/redo mechanism).
14+
/// </summary>
15+
publicclassMoveToPositionAction
16+
{
17+
publicint?Position{get;set;}
18+
}
2119

22-
/// <summary>
23-
/// Action dispatched when the user selects an action in the list of current (dispatched) actions.
24-
/// </summary>
25-
publicclassSelectPositionAction
26-
{
27-
publicint?Position{get;set;}
28-
}
29-
30-
/// <summary>
31-
/// Toggle play/pause store to forward redone actions.
32-
/// </summary>
33-
publicclassTogglePlayPauseAction{}
20+
/// <summary>
21+
/// Action dispatched when the user selects an action in the list of current (dispatched) actions.
22+
/// </summary>
23+
publicclassSelectPositionAction
24+
{
25+
publicint?Position{get;set;}
3426
}
27+
28+
/// <summary>
29+
/// Toggle play/pause store to forward redone actions.
30+
/// </summary>
31+
publicclassTogglePlayPauseAction{}
Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
1-
usingSystem.Collections.Immutable;
1+
namespaceReduxSimple.DevTools;
22

3-
namespaceReduxSimple.DevTools
3+
/// <summary>
4+
/// State used (internally) to display information about the Application Store.
5+
/// </summary>
6+
publicclassDevToolsState
47
{
58
/// <summary>
6-
///State used (internally) to display information about the Application Store.
9+
///List of current (dispatched) actions in the Application Store.
710
/// </summary>
8-
publicclassDevToolsState
9-
{
10-
/// <summary>
11-
/// List of current (dispatched) actions in the Application Store.
12-
/// </summary>
13-
publicImmutableList<ReduxActionInfo>CurrentActions{get;set;}=ImmutableList<ReduxActionInfo>.Empty;
11+
publicImmutableList<ReduxActionInfo>CurrentActions{get;set;}=ImmutableList<ReduxActionInfo>.Empty;
1412

15-
/// <summary>
16-
/// List of undone actions in the Application Store.
17-
/// </summary>
18-
publicImmutableList<ReduxActionInfo>FutureActions{get;set;}=ImmutableList<ReduxActionInfo>.Empty;
13+
/// <summary>
14+
/// List of undone actions in the Application Store.
15+
/// </summary>
16+
publicImmutableList<ReduxActionInfo>FutureActions{get;set;}=ImmutableList<ReduxActionInfo>.Empty;
1917

20-
/// <summary>
21-
/// Index of the selected action in the list of current (dispatched) actions.
22-
/// </summary>
23-
publicintSelectedActionPosition{get;set;}=0;
18+
/// <summary>
19+
/// Index of the selected action in the list of current (dispatched) actions.
20+
/// </summary>
21+
publicintSelectedActionPosition{get;set;}=0;
2422

25-
/// <summary>
26-
/// Activated to play/pause store to forward redone actions.
27-
/// </summary>
28-
publicboolPlaySessionActive{get;set;}=false;
29-
}
23+
/// <summary>
24+
/// Activated to play/pause store to forward redone actions.
25+
/// </summary>
26+
publicboolPlaySessionActive{get;set;}=false;
3027
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
globalusingSystem;
2+
globalusingSystem.Collections.Immutable;
3+
globalusingSystem.Collections.Generic;
4+
globalusingSuccincT.Options;

‎ReduxSimple.DevTools/Reducers.cs‎

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,37 @@
11
usingConverto;
2-
usingSystem.Collections.Generic;
32
usingstaticReduxSimple.Reducers;
43

5-
namespaceReduxSimple.DevTools
4+
namespaceReduxSimple.DevTools;
5+
6+
publicstaticclassReducers
67
{
7-
publicstaticclassReducers
8+
publicstaticIEnumerable<On<DevToolsState>>CreateReducers()
89
{
9-
publicstaticIEnumerable<On<DevToolsState>>CreateReducers()
10+
returnnewList<On<DevToolsState>>
1011
{
11-
returnnewList<On<DevToolsState>>
12-
{
13-
On<TogglePlayPauseAction,DevToolsState>(
14-
state=>state.With(new{PlaySessionActive=!state.PlaySessionActive})
15-
),
16-
On<SelectPositionAction,DevToolsState>(
17-
(state,action)=>state.With(new{SelectedActionPosition=action.Position})
18-
),
19-
On<HistoryUpdated,DevToolsState>(
20-
(state,action)=>
21-
{
22-
boolsetPositionToLastAction=state.SelectedActionPosition>=state.CurrentActions.Count-1;
12+
On<TogglePlayPauseAction,DevToolsState>(
13+
state=>state.With(new{PlaySessionActive=!state.PlaySessionActive})
14+
),
15+
On<SelectPositionAction,DevToolsState>(
16+
(state,action)=>state.With(new{SelectedActionPosition=action.Position})
17+
),
18+
On<HistoryUpdated,DevToolsState>(
19+
(state,action)=>
20+
{
21+
boolsetPositionToLastAction=state.SelectedActionPosition>=state.CurrentActions.Count-1;
2322

24-
returnstate.With(
25-
new
26-
{
27-
action.CurrentActions,
28-
action.FutureActions,
29-
SelectedActionPosition=setPositionToLastAction&&action.CurrentActions!=null
30-
?action.CurrentActions.Count-1
31-
:state.SelectedActionPosition
32-
}
33-
);
34-
}
35-
)
36-
};
37-
}
23+
returnstate.With(
24+
new
25+
{
26+
action.CurrentActions,
27+
action.FutureActions,
28+
SelectedActionPosition=setPositionToLastAction&&action.CurrentActions!=null
29+
?action.CurrentActions.Count-1
30+
:state.SelectedActionPosition
31+
}
32+
);
33+
}
34+
)
35+
};
3836
}
3937
}
Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
1-
usingSystem;
1+
namespaceReduxSimple.DevTools;
22

3-
namespaceReduxSimple.DevTools
3+
/// <summary>
4+
/// Redux action details used in the Redux DevTools.
5+
/// </summary>
6+
publicclassReduxActionInfo
47
{
58
/// <summary>
6-
///Redux action details used intheRedux DevTools.
9+
///The date whentheaction was dispatched.
710
/// </summary>
8-
publicclassReduxActionInfo
9-
{
10-
/// <summary>
11-
/// The date when the action was dispatched.
12-
/// </summary>
13-
publicDateTime?Date{get;set;}
11+
publicDateTime?Date{get;set;}
1412

15-
/// <summary>
16-
/// The type of the action.
17-
/// </summary>
18-
publicType?Type{get;set;}
13+
/// <summary>
14+
/// The type of the action.
15+
/// </summary>
16+
publicType?Type{get;set;}
1917

20-
/// <summary>
21-
/// The payload of the action.
22-
/// </summary>
23-
publicobject?Data{get;set;}
18+
/// <summary>
19+
/// The payload of the action.
20+
/// </summary>
21+
publicobject?Data{get;set;}
2422

25-
/// <summary>
26-
/// The state before the action was dispatched in the store.
27-
/// </summary>
28-
publicobject?PreviousState{get;set;}
23+
/// <summary>
24+
/// The state before the action was dispatched in the store.
25+
/// </summary>
26+
publicobject?PreviousState{get;set;}
2927

30-
/// <summary>
31-
/// The state after the action was dispatched in the store.
32-
/// </summary>
33-
publicobject?NextState{get;set;}
34-
}
28+
/// <summary>
29+
/// The state after the action was dispatched in the store.
30+
/// </summary>
31+
publicobject?NextState{get;set;}
3532
}

‎ReduxSimple.DevTools/ReduxSimple.DevTools.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageIconUrl>https://raw.githubusercontent.com/Odonno/ReduxSimple/master/images/logo.png</PackageIconUrl>
1515
<PackageTags>Redux Reactive ReactiveExtensions Rx ReduxSimple State Management DevTools</PackageTags>
1616

17-
<LangVersion>8.0</LangVersion>
17+
<LangVersion>latest</LangVersion>
1818
<Nullable>enable</Nullable>
1919
</PropertyGroup>
2020

‎ReduxSimple.DevTools/Selectors.cs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
usingSuccincT.Options;
2-
usingSystem.Collections.Immutable;
3-
usingstaticReduxSimple.Selectors;
1+
usingstaticReduxSimple.Selectors;
42

53
namespaceReduxSimple.DevTools
64
{
Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,50 @@
1-
usingSystem;
2-
usingSystem.Collections.Generic;
1+
namespaceReduxSimple.Entity;
32

4-
namespaceReduxSimple.Entity
3+
/// <summary>
4+
/// Adapter of an <see cref="EntityState{TKey, TEntity}"/> with the different reducer functions to handle entity manipulation.
5+
/// </summary>
6+
/// <typeparam name="TKey">Primary key of the entity.</typeparam>
7+
/// <typeparam name="TEntity">Type of the entity.</typeparam>
8+
publicsealedclassEntityAdapter<TKey,TEntity>:EntityStateAdapter<TKey,TEntity>
9+
whereTEntity:class
510
{
11+
privateEntityAdapter()
12+
{
13+
}
14+
615
/// <summary>
7-
///Adapter of an<see cref="EntityState{TKey, TEntity}"/> with the different reducer functions to handle entity manipulation.
16+
///Get selectors for the specified<see cref="EntityState{TKey, TEntity}"/>.
817
/// </summary>
9-
/// <typeparam name="TKey">Primary key of the entity.</typeparam>
10-
/// <typeparam name="TEntity">Type of the entity.</typeparam>
11-
publicsealedclassEntityAdapter<TKey,TEntity>:EntityStateAdapter<TKey,TEntity>
12-
whereTEntity:class
18+
/// <returns>A new Entity Selectors.</returns>
19+
publicEntitySelectors<TKey,TEntity>GetSelectors()
1320
{
14-
privateEntityAdapter()
15-
{
16-
}
17-
18-
/// <summary>
19-
/// Get selectors for the specified <see cref="EntityState{TKey, TEntity}"/>.
20-
/// </summary>
21-
/// <returns>A new Entity Selectors.</returns>
22-
publicEntitySelectors<TKey,TEntity>GetSelectors()
23-
{
24-
returnnewEntitySelectors<TKey,TEntity>(SortComparer);
25-
}
26-
/// <summary>
27-
/// Get selectors for the specified <see cref="EntityState{TKey, TEntity}"/>.
28-
/// </summary>
29-
/// <typeparam name="TInput">Part of the state used to create selectors.</typeparam>
30-
/// <param name="selectEntityState">Function used to select <see cref="EntityState{TKey, TEntity}"/> from the <typeparamref name="TInput"/>.</param>
31-
/// <returns>A new Entity Selectors.</returns>
32-
publicEntitySelectors<TInput,TKey,TEntity>GetSelectors<TInput>(
33-
ISelectorWithoutProps<TInput,EntityState<TKey,TEntity>>selectEntityState
34-
)
35-
{
36-
returnnewEntitySelectors<TInput,TKey,TEntity>(selectEntityState,SortComparer);
37-
}
21+
returnnewEntitySelectors<TKey,TEntity>(SortComparer);
22+
}
23+
/// <summary>
24+
/// Get selectors for the specified <see cref="EntityState{TKey, TEntity}"/>.
25+
/// </summary>
26+
/// <typeparam name="TInput">Part of the state used to create selectors.</typeparam>
27+
/// <param name="selectEntityState">Function used to select <see cref="EntityState{TKey, TEntity}"/> from the <typeparamref name="TInput"/>.</param>
28+
/// <returns>A new Entity Selectors.</returns>
29+
publicEntitySelectors<TInput,TKey,TEntity>GetSelectors<TInput>(
30+
ISelectorWithoutProps<TInput,EntityState<TKey,TEntity>>selectEntityState
31+
)
32+
{
33+
returnnewEntitySelectors<TInput,TKey,TEntity>(selectEntityState,SortComparer);
34+
}
3835

39-
/// <summary>
40-
/// Creates a new <see cref="EntityAdapter{TKey, TEntity}"/>.
41-
/// </summary>
42-
/// <param name="selectId">Function used to get the id of an entity.</param>
43-
/// <param name="sortComparer">Comparer used to sort the collection of entities.</param>
44-
/// <returns>A new Entity Adapter.</returns>
45-
publicstaticEntityAdapter<TKey,TEntity>Create(Func<TEntity,TKey>selectId,IComparer<TEntity>sortComparer=null)
36+
/// <summary>
37+
/// Creates a new <see cref="EntityAdapter{TKey, TEntity}"/>.
38+
/// </summary>
39+
/// <param name="selectId">Function used to get the id of an entity.</param>
40+
/// <param name="sortComparer">Comparer used to sort the collection of entities.</param>
41+
/// <returns>A new Entity Adapter.</returns>
42+
publicstaticEntityAdapter<TKey,TEntity>Create(Func<TEntity,TKey>selectId,IComparer<TEntity>sortComparer=null)
43+
{
44+
returnnewEntityAdapter<TKey,TEntity>
4645
{
47-
returnnewEntityAdapter<TKey,TEntity>
48-
{
49-
SelectId=selectId,
50-
SortComparer=sortComparer
51-
};
52-
}
46+
SelectId=selectId,
47+
SortComparer=sortComparer
48+
};
5349
}
5450
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp