TinyBase logoTinyBase β

RowView

RowView(
  this: void,
  props: RowViewProps,
): {
  $on?: (type: string, callback: (e: any) => void): () => void;
  $set?: (props: Partial<RowViewProps>): void;
}
TypeDescription
thisvoid
propsRowViewProps

The props passed to the component.

returns{ $on?: (type: string, callback: (e: any) => void): () => void; $set?: (props: Partial<RowViewProps>): void; }

Example

This example creates TinyBase objects outside the component and renders the Svelte component with them.

App.svelte
<script>
  import {RowView} from 'tinybase/ui-svelte';

  export let store;
</script>

<RowView tableId="pets" rowId="fido" {store} customCellIds={['species']} />
import {flushSync, mount} from 'svelte';
import {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 app = document.body.appendChild(document.createElement('div'));
flushSync(() => mount(App, {target: app, props: {store}}));
console.log(app.textContent);
// -> 'dog'

Since

v8.1.0