Skip to content

Commit aa62857

Browse files
committed
Options couldn't be set in different top-level layouts.
Fixes #30.
1 parent c547019 commit aa62857

File tree

8 files changed

+457
-415
lines changed

8 files changed

+457
-415
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Headlines: Added, Changed, Deprecated, Removed, Fixed, Security
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.2.2] - 2023-11-13
9+
10+
### Fixed
11+
12+
- Options couldn't be set in different top-level layouts.
13+
814
## [2.2.1] - 2023-09-11
915

1016
### Fixed

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ flash.subscribe(($flash) => {
275275

276276
## Flash message options
277277

278-
The first time you call `getFlash` for a `page`, you can specify options:
278+
In a top-level component, most likely a `+layout.svelte` file, when you call `getFlash` for a `page`, you can specify options. **Note** that options can only be set the first time you call `getFlash` for a certain page/layout, usually in the top-level component. Subsequent calls to `getFlash` in components below cannot have any options. (See the first call to it as a kind of constructor.)
279279

280280
```typescript
281281
const flash = getFlash(page, {
@@ -298,14 +298,8 @@ Can be set to a number of milliseconds before the flash message is automatically
298298

299299
If you specify `App.PageData['flash']` as an array, the library will accomodate for that and will concatenate messages into the array instead of replacing them. But if you want to always clear the previous messages, set the `clearArray` option to `true`.
300300

301-
Again, note that you can only set options the first time you call `getFlash` for a certain page/layout, usually in the top-level component. Subsequent calls to `getFlash` in components below cannot have any options. (See the first call to it as a kind of constructor.)
302-
303301
### flashCookieOptions
304302

305-
See right below.
306-
307-
## Cookie options
308-
309303
You can change the options for the cookie being sent, like this on the server:
310304

311305
```ts

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,26 @@
2828
"format": "prettier --plugin-search-dir . --write ."
2929
},
3030
"devDependencies": {
31-
"@sveltejs/adapter-auto": "^2.1.0",
32-
"@sveltejs/kit": "^1.22.3",
33-
"@sveltejs/package": "^2.2.0",
31+
"@sveltejs/adapter-auto": "^2.1.1",
32+
"@sveltejs/kit": "^1.27.3",
33+
"@sveltejs/package": "^2.2.2",
3434
"@typescript-eslint/eslint-plugin": "^5.62.0",
3535
"@typescript-eslint/parser": "^5.62.0",
36-
"eslint": "^8.45.0",
37-
"eslint-config-prettier": "^8.8.0",
38-
"eslint-plugin-svelte": "^2.32.2",
36+
"eslint": "^8.53.0",
37+
"eslint-config-prettier": "^8.10.0",
38+
"eslint-plugin-svelte": "^2.34.1",
3939
"esm-env": "^1.0.0",
4040
"prettier": "^2.8.8",
4141
"prettier-plugin-svelte": "^2.10.1",
4242
"publint": "^0.1.16",
43-
"sass": "^1.63.6",
44-
"svelte": "^4.0.5",
45-
"svelte-check": "^3.4.6",
46-
"svelte-french-toast": "^1.1.0",
43+
"sass": "^1.69.5",
44+
"svelte": "^4.2.2",
45+
"svelte-check": "^3.5.2",
46+
"svelte-french-toast": "^1.2.0",
4747
"svelte-preprocess": "^5.0.4",
48-
"tslib": "^2.6.0",
49-
"typescript": "^5.1.6",
50-
"vite": "^4.4.4"
48+
"tslib": "^2.6.2",
49+
"typescript": "^5.2.2",
50+
"vite": "^4.5.0"
5151
},
5252
"peerDependencies": {
5353
"@sveltejs/kit": "1.x",

0 commit comments

Comments
 (0)