@ignt/vue
Advanced tools
Comparing version 0.0.7-alpha to 0.0.8-alpha
{ | ||
"name": "@ignt/vue", | ||
"version": "0.0.7-alpha", | ||
"version": "0.0.8-alpha", | ||
"description": "Autogenerated Vue API", | ||
@@ -5,0 +5,0 @@ "author": "Ignite Codegen <hello@ignt.com>", |
@@ -5,3 +5,3 @@ // THIS FILE IS GENERATED AUTOMATICALLY. DO NOT MODIFY. | ||
import { createIgnite, Ignite, registry } from '@ignt/client' | ||
import { reactive, } from 'vue' | ||
import { ToRefs, toRefs, reactive } from 'vue' | ||
@@ -14,5 +14,9 @@ // defaults | ||
type State = { | ||
ignite: Ignite | ||
} | ||
// singleton state | ||
const ignite = reactive( | ||
createIgnite({ | ||
const state = reactive({ | ||
ignite: createIgnite({ | ||
env: { | ||
@@ -24,7 +28,7 @@ apiURL, | ||
} | ||
}).connectWS() | ||
) | ||
}).connectWS() as Ignite | ||
} as State) | ||
type Response = { | ||
ignite: Ignite | ||
state: ToRefs<State> | ||
signIn: (offlineSigner: OfflineDirectSigner) => void | ||
@@ -34,3 +38,5 @@ signOut: () => void | ||
export default function(): Response { | ||
export default function (): Response { | ||
let ignite = state.ignite | ||
let signIn = async (offlineSigner: OfflineDirectSigner) => { | ||
@@ -53,6 +59,6 @@ let [acc] = await offlineSigner.getAccounts() | ||
return { | ||
ignite: ignite as Ignite, | ||
state: toRefs(state), | ||
signIn, | ||
signOut | ||
} | ||
} | ||
} |
39976
901