svelte-object

1.4.2 • Public • Published


👉   Define objects in your markup-structure!
💫   Driven by svelte stores for highly robust code
🔥   Custom valueStore to handle (subscribable) error and warning messages


Get started with literal wizardry!🧙‍♂️
npm i -D svelte-object  /  pnpm add -D svelte-object


This could be your code See REPL

<h3> An array of pets </h3>

<Array name='pets' let:value>
	{#each value as item, k}
		<Object name={k}>
			<Input name='name'>Pets name</Input>
			<Input name='age' type='number'>Pets age</Input>
		</Object>
		<button on:click={() => value.removeByIndex(k)}> Remove {item.name} </button>
	{/each}
	<button on:click={() => value.push({})}> Add pet </button>
</Array>

Note
What are you waiting for? Get Started!



Package Sidebar

Install

npm i svelte-object

Weekly Downloads

119

Version

1.4.2

License

MIT

Unpacked Size

50.2 kB

Total Files

35

Last publish

Collaborators

  • refzlund