CheckpointView
CheckpointView(
this: void,
props: CheckpointViewProps,
): {
$on?: (type: string, callback: (e: any) => void): () => void;
$set?: (props: Partial<CheckpointViewProps>): void;
}| Type | Description | |
|---|---|---|
this | void | |
props | CheckpointViewProps | The props passed to the component. |
| returns | { $on?: (type: string, callback: (e: any) => void): () => void; $set?: (props: Partial<CheckpointViewProps>): void; } |
Example
This example creates TinyBase objects outside the component and renders the Svelte component with them.
App.svelte
<script>
import {CheckpointView} from 'tinybase/ui-svelte';
export let checkpoints;
</script>
<CheckpointView checkpointId="0" {checkpoints} />
import {flushSync, mount} from 'svelte';
import {createCheckpoints, createStore} from 'tinybase';
import App from './App.svelte';
const store = createStore()
.setTables({
pets: {
fido: {species: 'dog', color: 'brown', sold: false, next: 'felix'},
felix: {species: 'cat', color: 'black', sold: true},
},
species: {dog: {price: 5}, cat: {price: 4}},
})
.setValues({open: true, employees: 3});
const checkpoints = createCheckpoints(store);
const app = document.body.appendChild(document.createElement('div'));
flushSync(() => mount(App, {target: app, props: {checkpoints}}));
console.log(app.textContent);
// -> ''
Since
v8.1.0