fluxie 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.2.1](https://github.com/LesFabricants/Fluxie/compare/v1.2.0...v1.2.1) (2024-06-04)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **store:** do not initialize in the upgrade event ([8a9b42d](https://github.com/LesFabricants/Fluxie/commit/8a9b42dddbee9382bdb10e9601fce9b1e8bd5b42))
9
+
3
10
  ## [1.2.0](https://github.com/LesFabricants/Fluxie/compare/v1.1.0...v1.2.0) (2024-06-04)
4
11
 
5
12
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{BehaviorSubject as p}from"rxjs";var r={},o=!1;function h(){o=!0}function l(i,t,s){if(!d())return!1;let e=window?.__REDUX_DEVTOOLS_EXTENSION__.connect({name:i});e.init(s),e.subscribe(n=>{n.type==="DISPATCH"&&n.payload.type==="JUMP_TO_ACTION"&&t.next(JSON.parse(n.state))}),r[i]=e}function c(i,t,s){if(!d())return!1;if(!o)throw new Error("Devtools not enabled, please call enableReduxDevtools() in app.module.ts");r[i].send(t,s)}function d(){return window?.__REDUX_DEVTOOLS_EXTENSION__!==void 0}import{toSignal as u}from"@angular/core/rxjs-interop";var a=class{options;state;select$;select;db;constructor(t,s){if(this.options={...s,storeName:s?.storeName??this.constructor.name},this.state=new p(t),this.select$=this.state.asObservable(),this.select=u(this.state),s?.cache){let e=globalThis.indexedDB.open("__FLUXIE_STORE",1);e.onerror=()=>{console.error(`IndexedDB error: ${e.error}`)},e.onsuccess=()=>{this.db=e.result,this.initializeFromIndexedDB()},e.onupgradeneeded=n=>{this.db=e.result,n.newVersion===1&&this.db.createObjectStore("cachedData"),this.initializeFromIndexedDB()}}o&&l(this.options.storeName,this.state,this.state.getValue())}setState(t,s){let e=s(this.state.getValue());this.state.next(e),this.options?.cache&&this.sendToIndexedDB(this.state.getValue()),o&&c(this.options.storeName,t,e)}async initializeFromIndexedDB(){let t=this.db.transaction("cachedData").objectStore("cachedData").get(this.options.storeName);t.onsuccess=()=>{let s=t.result;s?this.state.next(s):this.sendToIndexedDB(this.state.getValue())}}async sendToIndexedDB(t){this.db.transaction("cachedData","readwrite").objectStore("cachedData").put(t,this.options.storeName)}};export{a as Store,h as enableReduxDevtools,o as isDevtoolEnabled};
1
+ import{BehaviorSubject as p}from"rxjs";var r={},o=!1;function h(){o=!0}function l(i,t,s){if(!d())return!1;let e=window?.__REDUX_DEVTOOLS_EXTENSION__.connect({name:i});e.init(s),e.subscribe(n=>{n.type==="DISPATCH"&&n.payload.type==="JUMP_TO_ACTION"&&t.next(JSON.parse(n.state))}),r[i]=e}function c(i,t,s){if(!d())return!1;if(!o)throw new Error("Devtools not enabled, please call enableReduxDevtools() in app.module.ts");r[i].send(t,s)}function d(){return window?.__REDUX_DEVTOOLS_EXTENSION__!==void 0}import{toSignal as u}from"@angular/core/rxjs-interop";var a=class{options;state;select$;select;db;constructor(t,s){if(this.options={...s,storeName:s?.storeName??this.constructor.name},this.state=new p(t),this.select$=this.state.asObservable(),this.select=u(this.state),s?.cache){let e=globalThis.indexedDB.open("__FLUXIE_STORE",1);e.onerror=()=>{console.error(`IndexedDB error: ${e.error}`)},e.onsuccess=()=>{this.db=e.result,this.initializeFromIndexedDB()},e.onupgradeneeded=n=>{this.db=e.result,n.newVersion===1&&this.db.createObjectStore("cachedData")}}o&&l(this.options.storeName,this.state,this.state.getValue())}setState(t,s){let e=s(this.state.getValue());this.state.next(e),this.options?.cache&&this.sendToIndexedDB(this.state.getValue()),o&&c(this.options.storeName,t,e)}async initializeFromIndexedDB(){let t=this.db.transaction("cachedData").objectStore("cachedData").get(this.options.storeName);t.onsuccess=()=>{let s=t.result;s?this.state.next(s):this.sendToIndexedDB(this.state.getValue())}}async sendToIndexedDB(t){this.db.transaction("cachedData","readwrite").objectStore("cachedData").put(t,this.options.storeName)}};export{a as Store,h as enableReduxDevtools,o as isDevtoolEnabled};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "fluxie",
3
3
  "description": "Small helper class to easily implement Flux architecture using angular service, complete with redux devtool and caching support",
4
4
  "authors": "Anthony Lenglet",
5
- "version": "1.2.0",
5
+ "version": "1.2.1",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "author": {
@@ -1,19 +0,0 @@
1
- on:
2
- push:
3
- branches:
4
- - main
5
-
6
- permissions:
7
- contents: write
8
- pull-requests: write
9
-
10
- name: cut-and-release
11
-
12
- jobs:
13
- release-please:
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: googleapis/release-please-action@v4
17
- with:
18
- token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
19
- release-type: node
@@ -1,20 +0,0 @@
1
- on:
2
- release:
3
- types: [published]
4
-
5
- name: publish-npm
6
-
7
- jobs:
8
- deploy-npm:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v3
12
- - uses: actions/setup-node@v3
13
- with:
14
- node-version-file: ".nvmrc"
15
- registry-url: "https://registry.npmjs.org"
16
- - run: npm install
17
- - run: npm run build
18
- - run: npm publish
19
- env:
20
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}