Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
28f1450d
Unverified
Commit
28f1450d
authored
Sep 20, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Less modifyState identity
parent
6a64b6e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
20 deletions
+18
-20
Documents.purs
src/Gargantext/Pages/Corpus/Doc/Facets/Documents.purs
+3
-3
API.purs
src/Gargantext/Pages/Corpus/User/Users/API.purs
+4
-6
Actions.purs
src/Gargantext/Pages/Layout/Actions.purs
+4
-4
Actions.purs
src/Gargantext/Pages/Layout/Specs/AddCorpus/Actions.purs
+7
-7
No files found.
src/Gargantext/Pages/Corpus/Doc/Facets/Documents.purs
View file @
28f1450d
...
...
@@ -186,11 +186,11 @@ performAction (ChangePageSize ps) _ _ = void (cotransform (\state -> changePage
performAction (ChangePage p) _ _ = void (cotransform (\(TableData td) -> TableData $ td { currentPage = p} ))
performAction LoadData _ _ =
void
do
performAction LoadData _ _ = do
res <- lift $ loadPage
case res of
Left err ->
cotransform $ \state -> state
Right resData -> modifyState (\s -> resData)
Left err ->
pure unit
Right resData ->
void $
modifyState (\s -> resData)
loadPage :: Aff (Either String CorpusTableData)
...
...
src/Gargantext/Pages/Corpus/User/Users/API.purs
View file @
28f1450d
...
...
@@ -18,13 +18,11 @@ getUser id = get $ "http://localhost:8008/node/" <> show id
performAction :: PerformAction State {} Action
performAction (FetchUser userId) _ _ =
void
do
performAction (FetchUser userId) _ _ = do
value <- lift $ getUser userId
_ <- case value of
(Right user) -> modifyState \state -> set _user (Just user) state
(Right user) ->
void $
modifyState \state -> set _user (Just user) state
(Left err) -> do
_ <- liftEffect $ log err
modifyState identity
liftEffect $ log err
liftEffect <<< log $ "Fetching user..."
performAction _ _ _ = void do
modifyState identity
performAction _ _ _ = pure unit
src/Gargantext/Pages/Layout/Actions.purs
View file @
28f1450d
...
...
@@ -67,14 +67,14 @@ performAction Initialize _ state = void do
case lnodes of
Left err -> do
modifyState identity
pure unit
Right d -> do
_ <- modifyState $ _ { initialized = true, ntreeState = d}
page <- lift $ DV.loadPage
case page of
Left err -> do
modifyState identity
Right docs -> do
pure unit
Right docs ->
void
do
modifyState $ _ { initialized = true
, ntreeState = d
-- if length d > 0
...
...
@@ -85,7 +85,7 @@ performAction Initialize _ state = void do
, docViewState = docs
}
_ -> do
modifyState identity
pure unit
performAction (LoginA _) _ _ = pure unit
performAction (AddCorpusA _) _ _ = pure unit
...
...
src/Gargantext/Pages/Layout/Specs/AddCorpus/Actions.purs
View file @
28f1450d
...
...
@@ -33,17 +33,17 @@ performAction (SelectDatabase selected) _ _ = void do
performAction (UnselectDatabase unselected) _ _ = void do
modifyState \( state) -> state { unselect_database = unselected }
performAction (LoadDatabaseDetails) _ _ =
void
do
performAction (LoadDatabaseDetails) _ _ = do
res <- lift $ getDatabaseDetails $ QueryString { query_query: "string",query_name: ["Pubmed"]}
case res of
Left err ->
modifyState $ \(state) -> state
Left err ->
pure unit
Right resData -> do
modifyState $ \(state) -> state {response = resData}
void $
modifyState $ \(state) -> state {response = resData}
performAction GO _ _ =
void
do
_ <-
liftEffect $ setHash "/corpus"
_ <-
liftEffect $ modalHide "addCorpus"
modifyState identity
performAction GO _ _ = do
liftEffect $ setHash "/corpus"
liftEffect $ modalHide "addCorpus"
pure unit
newtype QueryString = QueryString
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment