@fluxo-dev/state 0.0.33 → 0.0.34

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/index.esm.js CHANGED
@@ -32,6 +32,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
32
32
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
33
33
  PERFORMANCE OF THIS SOFTWARE.
34
34
  ***************************************************************************** */
35
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
36
+
35
37
 
36
38
  function __awaiter(thisArg, _arguments, P, generator) {
37
39
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -48,12 +50,12 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
48
50
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
49
51
  };
50
52
 
51
- const userLogin = createAsyncThunk('user/login', ({
53
+ const userLogin = createAsyncThunk('user/login', (_a, _b) => __awaiter(void 0, [_a, _b], void 0, function* ({
52
54
  data
53
55
  }, {
54
56
  rejectWithValue,
55
57
  getState
56
- }) => __awaiter(void 0, void 0, void 0, function* () {
58
+ }) {
57
59
  try {
58
60
  return data;
59
61
  } catch (error) {
@@ -82,7 +84,9 @@ var _a, _b;
82
84
  const initialState$1 = {
83
85
  loading: false,
84
86
  userInfo: JSON.parse((_a = localStorage.getItem(LocalStorageConstants.userData)) !== null && _a !== void 0 ? _a : '{}'),
87
+ // for user object
85
88
  accessToken: localStorage.getItem((_b = LocalStorageConstants.accessToken) !== null && _b !== void 0 ? _b : ''),
89
+ // for storing the JWT
86
90
  error: false,
87
91
  success: false,
88
92
  loggedIn: false,
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@fluxo-dev/state",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "module": "./index.esm.js",
5
5
  "type": "module",
6
- "main": "./index.esm.js"
6
+ "main": "./index.esm.js",
7
+ "types": "./index.esm.d.ts"
7
8
  }
@@ -3,7 +3,7 @@ export declare const userLogin: import("@reduxjs/toolkit").AsyncThunk<any, {
3
3
  } & Partial<any>, {
4
4
  rejectValue: any;
5
5
  state?: unknown;
6
- dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
6
+ dispatch?: import("redux").Dispatch | undefined;
7
7
  extra?: unknown;
8
8
  serializedErrorType?: unknown;
9
9
  pendingMeta?: unknown;
@@ -12,7 +12,7 @@ export declare const userLogin: import("@reduxjs/toolkit").AsyncThunk<any, {
12
12
  }>;
13
13
  export declare const userLogout: import("@reduxjs/toolkit").AsyncThunk<boolean, void, {
14
14
  state?: unknown;
15
- dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
15
+ dispatch?: import("redux").Dispatch;
16
16
  extra?: unknown;
17
17
  rejectValue?: unknown;
18
18
  serializedErrorType?: unknown;