@feardread/feature-factory 2.0.1 → 2.0.3
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/dist/bundle.min.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/api/factory.js +4 -4
- package/src/factory/factory.js +2 -2
package/package.json
CHANGED
package/src/api/factory.js
CHANGED
|
@@ -5,11 +5,11 @@ import cache from "../cache/cache.js";
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
const InstanceFactory =
|
|
9
|
-
|
|
8
|
+
const InstanceFactory = (( options ) => {
|
|
9
|
+
console.log('Instance Opts = ', options)
|
|
10
10
|
const API_BASE_URL = (options.API_BASE_URL)
|
|
11
11
|
? options.API_BASE_URL
|
|
12
|
-
: "http://fear.master.com
|
|
12
|
+
: "http://fear.master.com/fear/api/";
|
|
13
13
|
|
|
14
14
|
const ACCESS_TOKEN_NAME = (options.JWT_TOKEN)
|
|
15
15
|
? options.JWT_TOKEN
|
|
@@ -71,7 +71,7 @@ const InstanceFactory = ( options ) => {
|
|
|
71
71
|
);
|
|
72
72
|
|
|
73
73
|
return instance;
|
|
74
|
-
}
|
|
74
|
+
})();
|
|
75
75
|
|
|
76
76
|
|
|
77
77
|
|
package/src/factory/factory.js
CHANGED
|
@@ -10,8 +10,9 @@ const StateFactory = (entity, data = null) => ({
|
|
|
10
10
|
|
|
11
11
|
const FeatureFactory = (sliceName, endpoint, options = {}) => {
|
|
12
12
|
const apiEndpoint = `${sliceName}/${endpoint}`;
|
|
13
|
+
|
|
13
14
|
const API = InstanceFactory({
|
|
14
|
-
API_BASE_URL: 'http://
|
|
15
|
+
API_BASE_URL: 'http://localhost:4000/fear/api',
|
|
15
16
|
JWT_TOKEN: 'fear-x-token'
|
|
16
17
|
});
|
|
17
18
|
|
|
@@ -116,7 +117,6 @@ const FeatureFactory = (sliceName, endpoint, options = {}) => {
|
|
|
116
117
|
return {
|
|
117
118
|
reducer: slice.reducer,
|
|
118
119
|
actions: slice.actions,
|
|
119
|
-
instance: API,
|
|
120
120
|
asyncActions: {
|
|
121
121
|
fetch,
|
|
122
122
|
fetchOne,
|