From 0c2c2851fcde05c15cac4cbf6d2a33d676c2007d Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Wed, 17 Jun 2020 10:08:16 -0600 Subject: [PATCH 1/5] added vscode snippets for connected components --- snippets/snippets.json | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/snippets/snippets.json b/snippets/snippets.json index 28e5f7fd4..1c8625b34 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -98,5 +98,30 @@ "}" ], "description": "Creates a stateful OverReact component with abbreviated props and state declarations" - } + }, + "connectedStatelessComponent": { + "prefix": "orStlessConnect", + "body": [ + "import 'package:over_react/over_react.dart';", + "import 'package:over_react/over_react_redux.dart';", + "", + "part '${1:FileName}.over_react.g.dart';", + "", + "UiFactory<${2:MyComponent}Props> ${2:MyComponent} = connect<${3:MyState}, ${2:MyComponent}Props>(", + "\tmapStateToProps: (state) => (${2:MyComponent}()),", + "\tmapDispatchToProps: (dispatch) => (${2:MyComponent}()),", + ")(_$${2:MyComponent}); // ignore: undefined_identifier", + "", + "mixin ${2:MyComponent}Props on UiProps {}", + "", + "class ${2:MyComponent}Component extends UiComponent2<${2:MyComponent}Props> {", + "\t@override", + "\tMap get defaultProps => (newProps());", + "", + "\t@override", + "\tReactElement render() { }", + "}" + ], + "description": "Creates a stateless and connected OverReact component" + } } From 2c945e7b44e6a54ad7b4d1d53d561f3dd791e28e Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Wed, 17 Jun 2020 10:20:36 -0600 Subject: [PATCH 2/5] added intelij snippet --- snippets/snippets.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/snippets/snippets.xml b/snippets/snippets.xml index 82aff5d60..9cb66f883 100644 --- a/snippets/snippets.xml +++ b/snippets/snippets.xml @@ -42,3 +42,11 @@