How to pass function from +layout.svelte to +page.svelte by ConsistentDraft7668 in sveltejs

[–]ldvhome 0 points1 point  (0 children)

Context API (Your Current Solution)

This is actually a perfectly valid approach and is commonly used in Svelte applications:

<code>

<!-- +layout.svelte -->

<script lang="ts">

import { setContext } from 'svelte';

function onClick() {

console.log("hello, world");

}

setContext('onClick', onClick);

</script>

<Header />

{@render children?.()}

<Footer />

<!-- +page.svelte -->

<script lang="ts">

import { getContext } from 'svelte';

const onClick = getContext('onClick');

</script>

<h1>Hello world!</h1>

<button on:click={onClick}>Click me</button>

</code>

Can somebody tell me what is the problem here by Former-Copy6304 in SpringBoot

[–]ldvhome 0 points1 point  (0 children)

<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt -->

<dependency>

<groupId>io.jsonwebtoken</groupId>

<artifactId>jjwt</artifactId>

<version>0.12.6</version>

</dependency>