Skip to content

Commit

Permalink
Merge pull request #2 from Lwdthe1/readme2
Browse files Browse the repository at this point in the history
Readme2
  • Loading branch information
Lwdthe1 authored Nov 14, 2019
2 parents 9274e68 + 8d39af5 commit ecb27e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ You can also specify placeholders for displaying shimmers while awaiting data fr

- [Install](#install)
- [Usage](#usage)
- [Example](#example)
- [Tests](#tests)
- [Contributing](#contributing)

## Install
# Install

`npm install --save array-datastore`

## Usage

![carbon (2)](https://user-images.githubusercontent.com/5778798/68903664-ab0e9a00-06f0-11ea-8532-57b2ef4ff414.png)
# Usage

1. `constructor.instance(configObject)` Create a new instance of the store with an optional configuration object.
2. `addUniqueObject()` Add an unique object to the store.
Expand All @@ -29,15 +28,19 @@ You can also specify placeholders for displaying shimmers while awaiting data fr
10. `hasPlaceholders()` Checks if the store has placeholder objects.
11. `clearPlaceholders()` Remove the placeholder objects from the store.

### config object
See the tests (`tests/dataStore_test.js`) to see how these methods are used.

## config object

When creating the store, you can specify an optional configuration object.

#### placeholders: `number|Array<Object>`
### placeholders: `number|Array<Object>`

You can specify a number of placeholders or an array of placeholder objects that will populate the store until you add your first actual object or you call the #clearPlaceholders() method.

See the tests (`tests/dataStore_test.js`) to see how these methods are used.
## Example

![carbon (4)](https://user-images.githubusercontent.com/5778798/68904124-fd9c8600-06f1-11ea-9d33-33a9f8613121.png)

## Tests

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "array-datastore",
"version": "1.0.4",
"version": "1.0.8",
"description": "A datastore to store unique objects in an array.",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit ecb27e6

Please sign in to comment.