From 6e67ac8778abfb67ae3b52b96b745205b50e6b41 Mon Sep 17 00:00:00 2001 From: jdecroock Date: Sun, 5 Apr 2020 13:17:18 +0200 Subject: [PATCH] prepare release --- README.md | 18 ++++++++++++++++-- src/dispatcher/index.ts | 3 ++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 66bc082..3127517 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ Initially this will be `title` and `meta`. - [x] Preact support - [x] Support `` - [x] Stricter typings -- [ ] SSR support +- [x] Document the hooks - [x] Document the dispatcher -- [ ] Document the hooks +- [ ] SSR support - [ ] Golf bytes ## Preact @@ -37,9 +37,23 @@ given string changes it will update the property. ### useMeta +This hook accepts the regular `` properties, being `name`, `property`, `httpEquiv`, +`charset` and `content`. + +These have to be passed as an object and will update when `content` changes. + ### useLink +This hook accepts the regular `` properties, being `rel`, `as`, `media`, +`href`, `sizes` and `crossorigin`. + +This will update within the same `useLink` but will never go outside + ### useLang This hook accepts a string that will be used to set the `lang` property on the base `` tag. Every time this string gets updated this will be reflected in the dom. + +## Dispatcher + +It can be interesting to give this a read, in the code itself. diff --git a/src/dispatcher/index.ts b/src/dispatcher/index.ts index 8e3a130..73098c0 100644 --- a/src/dispatcher/index.ts +++ b/src/dispatcher/index.ts @@ -58,7 +58,8 @@ const changeOrCreateMetaTag = (meta: MetaPayload) => { * --> useTitle('y') * * Will display 'x' due to the effects resolving bottom-up, instead we schedule - * both meta and titles in batches. + * both meta and titles in batches. This way we can display 'y' and keep 'x' around + * as a fallback if would unmount it will update to 'x'. * * When this batch is processed we only take one of each kind of meta and one title. *