korajs 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -17
- package/dist/chunk-WALHLVVF.js +683 -0
- package/dist/chunk-WALHLVVF.js.map +1 -0
- package/dist/index.cjs +1316 -347
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +92 -37
- package/dist/index.d.ts +92 -37
- package/dist/index.js +687 -376
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +47 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.cts +3 -0
- package/dist/react.d.ts +3 -0
- package/dist/react.js +24 -0
- package/dist/react.js.map +1 -0
- package/dist/svelte.cjs +71 -0
- package/dist/svelte.cjs.map +1 -0
- package/dist/svelte.d.cts +1 -0
- package/dist/svelte.d.ts +1 -0
- package/dist/svelte.js +48 -0
- package/dist/svelte.js.map +1 -0
- package/dist/testing.cjs +700 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +111 -0
- package/dist/testing.d.ts +111 -0
- package/dist/testing.js +13 -0
- package/dist/testing.js.map +1 -0
- package/dist/vue.cjs +57 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.d.cts +1 -0
- package/dist/vue.d.ts +1 -0
- package/dist/vue.js +34 -0
- package/dist/vue.js.map +1 -0
- package/package.json +83 -7
package/README.md
CHANGED
|
@@ -49,29 +49,32 @@ Conflicts are resolved automatically. No distributed systems code required.
|
|
|
49
49
|
|
|
50
50
|
## React Integration
|
|
51
51
|
|
|
52
|
-
Install `@korajs/react`
|
|
52
|
+
Install `@korajs/react` or import from `korajs/react`:
|
|
53
53
|
|
|
54
54
|
```tsx
|
|
55
|
-
import { KoraProvider, useQuery, useMutation } from '
|
|
56
|
-
|
|
57
|
-
function App() {
|
|
58
|
-
return (
|
|
59
|
-
<KoraProvider app={app}>
|
|
60
|
-
<TodoList />
|
|
61
|
-
</KoraProvider>
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function TodoList() {
|
|
66
|
-
const todos = useQuery(app.todos.where({ completed: false }))
|
|
67
|
-
const addTodo = useMutation(app.todos.insert)
|
|
68
|
-
return todos.map((todo) => <div key={todo.id}>{todo.title}</div>)
|
|
69
|
-
}
|
|
55
|
+
import { KoraProvider, useQuery, useMutation } from 'korajs/react'
|
|
70
56
|
```
|
|
71
57
|
|
|
58
|
+
## Vue 3 Integration
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { KoraProvider, useQuery, useMutation } from 'korajs/vue'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Requires `vue` and `@korajs/vue` as peer dependencies.
|
|
65
|
+
|
|
66
|
+
## Svelte Integration
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { createQueryStore, useQuery, useMutation } from 'korajs/svelte'
|
|
70
|
+
import KoraProvider from '@korajs/svelte/KoraProvider.svelte'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Requires `svelte` and `@korajs/svelte` as peer dependencies. Wrap your app with `<KoraProvider app={kora}>` (see `@korajs/svelte` README).
|
|
74
|
+
|
|
72
75
|
## Packages
|
|
73
76
|
|
|
74
|
-
`@korajs/core` | `@korajs/store` | `@korajs/merge` | `@korajs/sync` | `@korajs/server` | `@korajs/react` | `@korajs/devtools` | `@korajs/cli`
|
|
77
|
+
`@korajs/core` | `@korajs/store` | `@korajs/merge` | `@korajs/sync` | `@korajs/server` | `@korajs/react` | `@korajs/vue` | `@korajs/svelte` | `@korajs/devtools` | `@korajs/cli`
|
|
75
78
|
|
|
76
79
|
## License
|
|
77
80
|
|