Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #96 from data-provider/release
Browse files Browse the repository at this point in the history
Release v2.0.7
  • Loading branch information
javierbrea authored Dec 27, 2020
2 parents 0c1cfcc + c204e45 commit edf24af
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
### Removed

## [2.0.7] - 2020-12-27

### Added
- docs(readme): Add example about using default tag

### Changed
- chore(deps): Update dependencies
- refactor: Use baseTags getter to define base tag (#94)

## [2.0.6] - 2020-12-14

### Changed
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ sessionStatus.query({ prop: "loggedIn" }).delete();
sessionStatus.delete();
```

## Tags

Providers created with this addon will have automatically the `memory` tag, so you can select all of them together using the `providers` methods as in:

```javascript
import { providers } from "@data-provider/core";

providers.getByTag("memory").cleanCache();
```

## Contributing

Contributors are welcome.
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-provider/memory",
"version": "2.0.6",
"version": "2.0.7",
"description": "Memory origin addon for Data Provider",
"keywords": [
"data-provider",
Expand Down Expand Up @@ -42,7 +42,7 @@
"devDependencies": {
"@babel/core": "7.12.10",
"@babel/preset-env": "7.12.10",
"@data-provider/core": "2.8.2",
"@data-provider/core": "2.9.0",
"@rollup/plugin-babel": "5.2.2",
"@rollup/plugin-commonjs": "17.0.0",
"@rollup/plugin-json": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.organization=data-provider
sonar.projectKey=data-provider-memory
sonar.projectVersion=2.0.6
sonar.projectVersion=2.0.7

sonar.sources=src,test
sonar.exclusions=node_modules/**
Expand Down
9 changes: 5 additions & 4 deletions src/Memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const TAG = "memory";

class Memory extends Provider {
constructor(id, options, query) {
const opts = options || {};
const tags = opts.tags ? [...opts.tags] : [];
tags.unshift(TAG);
super(id, { ...opts, tags }, query);
super(id, options, query);
this._data = this.initialState.data;
this.options._data = this._options._data || this._data;
}
Expand Down Expand Up @@ -75,6 +72,10 @@ class Memory extends Provider {
this._cleanParentCache();
return Promise.resolve();
}

get baseTags() {
return TAG;
}
}

export default Memory;

0 comments on commit edf24af

Please sign in to comment.