mirror of https://github.com/sveltejs/svelte
[feat] Make setContext return the value that was passed in (#7432)
* return value from setContext * update docs * Add test * eof new line * pacify the linter * const and tabspull/6583/head
parent
707455fa8b
commit
afd3f4e5a9
@ -0,0 +1,5 @@
|
||||
export default {
|
||||
html: `
|
||||
<div>true</div>
|
||||
`
|
||||
};
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
import { setContext } from 'svelte';
|
||||
const a = {};
|
||||
const b = setContext('foo', a);
|
||||
</script>
|
||||
|
||||
<div>{a === b}</div>
|
Loading…
Reference in new issue