From 6ec5e69d0c4ca2dfd817ceb5704610ec6302fa7f Mon Sep 17 00:00:00 2001 From: Victor Camnerin Date: Thu, 16 Apr 2020 14:04:27 +0200 Subject: [PATCH] Add useSelector and useDispatch Proposel for this issue: https://github.com/dsznajder/vscode-es7-javascript-react-snippets/issues/120 --- snippets/snippets.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/snippets/snippets.json b/snippets/snippets.json index 3eab669..5ac00b4 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -1460,6 +1460,18 @@ "}, [${3:input}])" ] }, + "useSelector": { + "prefix": "useSelector", + "body": [ + "const ${1:state} = useSelector(state => state.${1:state})" + ] + }, + "useDispatch": { + "prefix": "useDispatch", + "body": [ + "const dispatch = useDispatch(${1:function})" + ] + }, "typeof": { "prefix": "tpf", "body": ["typeof ${0}"]