Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/darkobits/dot-dot-dot
ðĪŠ Random loading messages, for fun and profit.
https://github.com/darkobits/dot-dot-dot
loading message messages random whimsy
Last synced: about 2 months ago
JSON representation
ðĪŠ Random loading messages, for fun and profit.
- Host: GitHub
- URL: https://github.com/darkobits/dot-dot-dot
- Owner: darkobits
- License: wtfpl
- Created: 2019-04-25T05:04:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-11T18:45:41.000Z (almost 2 years ago)
- Last Synced: 2024-09-24T12:18:38.018Z (4 months ago)
- Topics: loading, message, messages, random, whimsy
- Language: TypeScript
- Homepage:
- Size: 2.74 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Get a random loading message.
## Install
```
npm i @darkobits/dot-dot-dot
```## Use
This package's default export is a function that returns a random message each time it is called.
```ts
import getMessage from '@darkobits/dot-dot-dot';getMessage() //=> 'Reticulating splines...'
```### `getMessageEvery`
This package additionally exports a function, `getMessageEvery`, which accepts an interval and returns a function that, when invoked, will return a random message that updates every `interval` milliseconds.
```ts
import {getMessageEvery} from '@darkobits/dot-dot-dot';const getMessageEveryTenSeconds = getMessageEvery(10000);
// T = 0ms
getMessageEveryTenSeconds(); // => 'Reticulating splines...';// T = 1000ms
getMessageEveryTenSeconds(); // => 'Reticulating splines...';// T = 1100ms
getMessageEveryTenSeconds(); // => 'Gathering particle sources...';
```