Skip to content

Commit 3c2112f

Browse files
committed
update README, clean the code
1 parent 2a93fc7 commit 3c2112f

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

quasar2-overmind-connect/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Quasar 2 + Typescript + Overmind
22

3-
Simple example of using Quasar 2 + TypeScript + Overmind 28 with connect
3+
Simple example of using Quasar v2 + TypeScript + Overmind v28 (with [connect()](https://overmindjs.org/views/vue#connect))
44

5-
- Quasar 2 <https://next.quasar.dev/>
5+
- Quasar 2 <https://quasar.dev/>
66
- Overmind <https://www.overmindjs.org/>
77
- TypeScript <https://www.typescriptlang.org/>
88

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div class="q-pb-lg">
3-
<q-btn round color="primary" icon="add" @click="actions.inc"/>
3+
<q-btn round color="primary" icon="add" @click="increment"/>
44
<span class="bg-gray-200 text-xl ml-3 mr-3 q-mx-sm text-h6">
5-
Counter: {{ state.counter }}
5+
Counter: {{ counter }}
66
</span>
7-
<q-btn round color="primary" icon="remove" @click="actions.dec"/>
7+
<q-btn round color="primary" icon="remove" @click="decrement"/>
88
</div>
99
</template>
1010

@@ -14,18 +14,14 @@ import { connect, Context } from '../overmind';
1414
1515
const Component = defineComponent({
1616
name: 'SimpleCounter',
17-
setup() {
18-
// const state = hooks.state();
19-
// const actions = hooks.actions();
20-
// return { state, actions };
21-
},
2217
});
2318
2419
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
2520
export default connect((context: Context) => {
2621
return {
27-
state: context.state,
28-
actions: context.actions
22+
counter: context.state.counter,
23+
increment: context.actions.inc,
24+
decrement: context.actions.dec,
2925
}
3026
}, Component);
3127
</script>

quasar2-overmind-connect/src/overmind/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { createConnect } from 'overmind-vue';
44
import * as actions from './actions';
55
import { state } from './state';
66

7-
// import { createHooks } from 'overmind-vue/vue3';
8-
97
export const config = {
108
state,
119
actions
@@ -21,7 +19,5 @@ export type Config = {
2119
// TS 3.9 using a TYPE (not INTERFACE)
2220
export type Context = IContext<Config>
2321

24-
// export const hooks = createHooks()
25-
26-
const overmind = createOvermind(config, { devtools: false });
22+
const overmind = createOvermind(config, { devtools: true });
2723
export const connect = createConnect(overmind)

0 commit comments

Comments
 (0)