onplan-app-svelte

Onplan App Svelte

Onplan app codebase migration from jQuery to svelte v3.54 ( Experimental )

Onplan App Svelte

Onplan app codebase using svelte v3


⚒️ Development

Install dependencies with npm install (or pnpm install or yarn), start a development server:

# Uses port 5173 by default
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

🚀 Building

To create a production version of your app:

npm run build

You can preview the production build with npm run preview.

To deploy your app, you may need to install an adapter for your target environment.


📗 API

Stores

Application states that are reactive.

  1. isOnline - True if connected to wifi/data REGARDLESS if have real internet connection. READONLY.

  2. isActuallyOnline - True if connected to wifi/data AND have real internet connection via http checking. With reCheck() utility function for updating the latest state. READONLY.

import { isOnline, isActuallyOnline } from '$lib/stores/connectivity';

// Note: Prefix stores with $ to access their values
consosle.log($isOnline); // log true or false
consosle.log($isActuallyOnline); // log true or false

// to update the latest "isActuallyOnline" value asynchronously
isActuallyOnline.reCheck();

// to get the latest "isActuallyOnline" value synchronously.
const withRealInternet = await isActuallyOnline.reCheck();
consosle.log(withRealInternet); // log true or false

Read more on: Prefixing $ in store object to access value

  1. to be continue...

Top categories

Loading Svelte Themes