From 4d063c03506edb40cc9dc4b394b453f51525468e Mon Sep 17 00:00:00 2001 From: Rong Sen Ng Date: Sat, 18 Apr 2020 23:32:47 +0800 Subject: [PATCH] v0.10.0 --- deep_clone/README.md | 2 +- delay_until/README.md | 2 +- jsmodern/README.md | 4 +-- lit_ntml/README.md | 49 +++++++++++++++++++++++++++++----- normalize_diacritics/README.md | 2 +- polling_observer/README.md | 2 +- 6 files changed, 49 insertions(+), 12 deletions(-) diff --git a/deep_clone/README.md b/deep_clone/README.md index 010aa6f..88e93b6 100644 --- a/deep_clone/README.md +++ b/deep_clone/README.md @@ -22,7 +22,7 @@ ```ts /** Import from GH via `denopkg` */ -import { deepClone } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/deep_clone/mod.ts"; +import { deepClone } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/deep_clone/mod.ts"; (async () => { const simpleObject = { diff --git a/delay_until/README.md b/delay_until/README.md index 9ea67fa..acbf8a8 100644 --- a/delay_until/README.md +++ b/delay_until/README.md @@ -21,7 +21,7 @@ ```ts /** Import from GH via `denopkg` */ -import { delayUntil } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/delay_until/mod.ts"; +import { delayUntil } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/delay_until/mod.ts"; (async () => { await delayUntil(3e3); diff --git a/jsmodern/README.md b/jsmodern/README.md index f94e6af..cfdcd22 100644 --- a/jsmodern/README.md +++ b/jsmodern/README.md @@ -20,8 +20,8 @@ ```ts // It is recommended to only import those extensions you need instead of everything. -import { extend } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/jsmodern/extend.ts"; -import { sum } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/jsmodern/array.ts"; +import { extend } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/jsmodern/extend.ts"; +import { sum } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/jsmodern/array.ts"; extend({ array: [sum] }); diff --git a/lit_ntml/README.md b/lit_ntml/README.md index d53e24a..5a149b9 100644 --- a/lit_ntml/README.md +++ b/lit_ntml/README.md @@ -13,19 +13,23 @@ ## Table of contents - [Usage](#usage) - - [html()](#html) - - [htmlFragment()](#htmlfragment) + - [html()](#html) + - [htmlSync()](#htmlsync) + - [htmlFragment()](#htmlfragment) + - [htmlFragmentSync()](#htmlfragmentsync) - [API Reference](#api-reference) - [html()](#html-1) + - [htmlSync()](#htmlsync-1) - [htmlFragment()](#htmlfragment-1) + - [htmlFragmentSync()](#htmlfragmentsync-1) - [License](#license) ## Usage -#### html() +### html() ```ts -import { html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/lit_ntml/mod.ts"; +import { html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/lit_ntml/mod.ts"; const peopleList = ["Cash Black", "Vict Fisherman"]; const syncTask = () => `

Hello, World!

`; @@ -37,10 +41,22 @@ const asyncListTask = async () => await html`${syncTask}${asyncLiteral}${asyncListTask}`; /**

Hello, World!

John Doe

*/ ``` -#### htmlFragment() +### htmlSync() + +```ts +import { htmlSync as html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/lit_ntml/mod.ts"; + +const peopleList = ['Cash Black', 'Vict Fisherman']; +const syncTask = () => `

Hello, World!

`; + +html`${syncTask}${peopleList}`; +/**

Hello, World!

Cash BlackVictFisherman */ +``` + +### htmlFragment() ```ts -import { htmlFragment as html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/lit_ntml/mod.ts"; +import { htmlFragment as html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/lit_ntml/mod.ts"; const syncTask = () => `

Hello, World!

`; const externalStyleLiteral = ``; @@ -49,16 +65,37 @@ const externalStyleLiteral = `

Hello, World!

*/ ``` +### htmlFragmentSync() + +```ts +import { htmlFragmentSync as html } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/lit_ntml/mod.ts"; + +const peopleList = ['Cash Black', 'Vict Fisherman']; +const syncTask = () => `

Hello, World!

`; +const asyncTask = Promise.resolve(1); + +html`${syncTask}${peopleList}${asyncTask}`; +/**

Hello, World!

Cash BlackVictFisherman[object Promise] */ +``` + ## API Reference ### html() - returns: <[Promise][promise-mdn-url]<[string][string-mdn-url]>> Promise which resolves with rendered HTML document string. +### htmlSync() + +This method works the same as `html()` except that this is the synchronous version. + ### htmlFragment() - returns: <[Promise][promise-mdn-url]<[string][string-mdn-url]>> Promise which resolves with rendered HTML document fragment string. +### htmlFragmentSync() + +This method works the same as `htmlFragment()` except that this is the synchronous version. + ## License [MIT License](http://motss.mit-license.org/) © Rong Sen Ng diff --git a/normalize_diacritics/README.md b/normalize_diacritics/README.md index b850c7a..fd17d51 100644 --- a/normalize_diacritics/README.md +++ b/normalize_diacritics/README.md @@ -22,7 +22,7 @@ ```ts /** Import from GH via `denopkg` */ -import { normalize } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/normalize_diacritics/mod.ts"; +import { normalize } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/normalize_diacritics/mod.ts"; (async () => { const str = "söme stüff with áccènts"; diff --git a/polling_observer/README.md b/polling_observer/README.md index 9eeb1da..2d4cf77 100644 --- a/polling_observer/README.md +++ b/polling_observer/README.md @@ -38,7 +38,7 @@ interface DataType { items: Record[]; } -import { PollingObserver } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.9.0/polling_observer/mod.ts"; +import { PollingObserver } from "https://cdn.jsdelivr.net/gh/motss/deno_mod@v0.10.0/polling_observer/mod.ts"; const obs = new PollingObserver((data /** list, observer */) => { const { status, items } = data || {};