Skip to content

Doesn't it work with the .js file? #523

Answered by jakobrosenberg
juliam73 asked this question in Q&A
Discussion options

You must be logged in to vote

$ has no meaning in vanilla JS, but when you use it in .svelte files, it gets compiled into JS.

In JS you have to use it like a normal store, eg.

import { goto } from '@roxi/routify';
import { get } from 'svelte/stores'

const $goto = get(goto)
$goto('/')

Testing for R3 should be much improved.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@juliam73
Comment options

Answer selected by juliam73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants