Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-06-01 17:05:03 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4c8671648aefe0d18065c0abb0c01149a4e599b8
4c867164
1 parent
826a4da0
remove useSubscription
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
front/src/Routes/Chat/ChatContainer.js
front/src/Routes/Chat/ChatContainer.js
View file @
4c86716
import
React
,
{
useEffect
}
from
"react"
;
import
{
useMutation
,
useQuery
,
useSubscription
}
from
"@apollo/react-hooks"
;
import
React
from
"react"
;
import
{
useMutation
,
useQuery
}
from
"@apollo/react-hooks"
;
import
ChatPresenter
from
"./ChatPresenter"
;
import
{
withRouter
}
from
"react-router-dom"
;
import
{
...
...
@@ -15,9 +15,6 @@ export default withRouter(({ location }) => {
const
{
pathname
}
=
location
;
const
roomName
=
pathname
.
slice
(
1
,
pathname
.
length
);
const
[
createMsg
]
=
useMutation
(
CREATE_MESSAGE
);
const
{
data
:
subMessage
}
=
useSubscription
(
SUBSCRIPTION_MSG
);
console
.
log
(
"subMessage : "
,
subMessage
);
const
message
=
useInput
(
""
);
...
...
@@ -46,15 +43,12 @@ export default withRouter(({ location }) => {
messageArray
=
messageList
;
}
let
testObj
;
testObj
=
subscribeToMore
({
document
:
subMessage
,
let
resultObj
=
subscribeToMore
({
document
:
SUBSCRIPTION_MSG
,
updateQuery
:
(
prev
,
{
subscriptionData
})
=>
{
console
.
log
(
"prev : "
,
prev
);
console
.
log
(
"subscriptionData : "
,
subscriptionData
);
if
(
!
subscriptionData
.
data
)
return
prev
;
},
});
console
.
log
(
testObj
);
const
onSubmit
=
async
(
e
)
=>
{
e
.
preventDefault
();
...
...
@@ -75,8 +69,6 @@ export default withRouter(({ location }) => {
}
};
useEffect
(()
=>
{});
return
(
<
ChatPresenter
location
=
{
location
}
...
...
Please
register
or
login
to post a comment