Giter VIP home page Giter VIP logo

svelte-hydrated's Introduction

svelte-hydrated

npm-version npm-license npm-download-month npm-min-size ci.yml website

๐Ÿ’ง Indicating hydration status by svelte-store

Installation

npm i svelte-hydrated

Example

The $hydrated store is updated to true at the next tick when the browser is true

<script>
  import { hydrated } from 'svelte-hydrated'
  import { slide } from 'svelte/transition'
</script>

{#if $hydrated}
  <h2 transition:slide>Hydrated</h2>
{:else}
  <h2 transition:slide>Not Hydrated</h2>
{/if}

Why not use browser ?

The browser ($app/environment) is useful for identifying the execution environment of the code, but its value is determined before the first rendering is started.
This means that transition etc. will not be triggered when hydration completes.
The $hydrated store is updated to true at the next tick when the browser is true, making it simpler to set transition.

License

MIT

svelte-hydrated's People

Contributors

wraith-ci[bot] avatar renovate[bot] avatar jill64 avatar dependabot[bot] avatar

Watchers

 avatar

svelte-hydrated's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • jill64/playwright-config main
npm
package.json
  • @jill64/eslint-config-svelte 1.3.10
  • @jill64/npm-demo-layout 1.0.249
  • @jill64/playwright-config 2.4.1
  • @jill64/prettier-config 1.0.0
  • @jill64/sentry-sveltekit-cloudflare 1.7.16
  • @jill64/universal-sanitizer 1.3.1
  • @playwright/test 1.46.1
  • @sveltejs/adapter-cloudflare 4.7.2
  • @sveltejs/kit 2.5.24
  • svelte 4.2.19
  • svelte-feather-icons 4.1.0
  • typescript 5.5.4
  • vite 5.4.2
  • vitest 2.0.5
  • @sveltejs/vite-plugin-svelte 3.1.2
  • @sveltejs/kit ^2.0.0
  • svelte ^4.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.