Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Frontend V2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GraphPolaris
Frontend V2
Merge requests
!135
geo intergation
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
geo intergation
feat/get_intergation
into
main
Overview
1
Commits
56
Pipelines
1
Changes
5
Merged
Leonardo Christino
requested to merge
feat/get_intergation
into
main
10 months ago
Overview
1
Commits
56
Pipelines
1
Changes
5
Expand
0
0
Merge request reports
Viewing commit
440ff939
Prev
Next
Show latest version
5 files
+
44
−
15
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
440ff939
feat(visManager): interaction slice
· 440ff939
Vink, S.A. (Sjoerd)
authored
11 months ago
libs/shared/lib/data-access/store/interactionSlice.ts
0 → 100644
+
35
−
0
Options
import
{
createSlice
,
PayloadAction
}
from
'
@reduxjs/toolkit
'
;
import
type
{
RootState
}
from
'
./store
'
;
export
type
HoverType
=
{
[
id
:
string
]:
any
};
export
type
SelectType
=
{
[
id
:
string
]:
any
};
// Define the initial state using that type
export
type
InteractionsType
=
{
hover
:
HoverType
|
undefined
;
select
:
SelectType
|
undefined
;
};
export
const
initialState
:
InteractionsType
=
{
hover
:
{},
select
:
{},
};
export
const
interactionSlice
=
createSlice
({
name
:
'
interaction
'
,
// `createSlice` will infer the state type from the `initialState` argument
initialState
,
reducers
:
{
addHover
:
(
state
,
action
:
PayloadAction
<
HoverType
|
undefined
>
)
=>
{
state
.
hover
=
action
.
payload
;
},
addSelect
:
(
state
,
action
:
PayloadAction
<
SelectType
|
undefined
>
)
=>
{
state
.
select
=
action
.
payload
;
},
},
});
export
const
{
addHover
,
addSelect
}
=
interactionSlice
.
actions
;
export
default
interactionSlice
.
reducer
;
Loading