jason-rails 0.6.1 → 0.6.2
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.
- checksums.yaml +4 -4
- data/client/lib/JasonContext.d.ts +1 -1
- data/client/lib/JasonContext.js +4 -1
- data/client/lib/index.d.ts +2 -0
- data/client/lib/index.js +3 -1
- data/client/lib/makeEager.js +2 -2
- data/client/src/JasonContext.ts +4 -1
- data/client/src/index.ts +3 -1
- data/client/src/makeEager.ts +2 -2
- data/lib/jason/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dae8eb61f7d3966c7e34ed81120a16e5c58f84d50ff6ea16ec87340d52cbf0ec
|
4
|
+
data.tar.gz: cd4bc1d677ec413e2368c235632410e744ab3d47f94e7c65160b7665d3a6db45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88130bf9bd8d557478de06bcdcb8901799425e3eeaf10a47a969152c13334659c8ffe36911fa2f3c18903a81c4291118e5f0c6daa72ac7a20545c095ab19f918
|
7
|
+
data.tar.gz: 3e708e8b214b74cce9dc87ec07b04bf5a4d1453c7398050be657dfe0c34f7668708352d7bef7d9305ffbb1321728267cbab9ab61f03460af3f7987f7d0381253
|
data/client/lib/JasonContext.js
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const react_1 = require("react");
|
4
|
-
const
|
4
|
+
const eager = function (entity, id, relations) {
|
5
|
+
console.error("Eager called but is not implemented");
|
6
|
+
};
|
7
|
+
const context = react_1.createContext({ actions: {}, subscribe: null, eager });
|
5
8
|
exports.default = context;
|
data/client/lib/index.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import _useAct from './useAct';
|
3
3
|
import _useSub from './useSub';
|
4
|
+
import _useEager from './useEager';
|
4
5
|
export declare const JasonProvider: ({ reducers, middleware, extraActions, children }: {
|
5
6
|
reducers?: any;
|
6
7
|
middleware?: any;
|
@@ -9,3 +10,4 @@ export declare const JasonProvider: ({ reducers, middleware, extraActions, child
|
|
9
10
|
}) => JSX.Element;
|
10
11
|
export declare const useAct: typeof _useAct;
|
11
12
|
export declare const useSub: typeof _useSub;
|
13
|
+
export declare const useEager: typeof _useEager;
|
data/client/lib/index.js
CHANGED
@@ -3,10 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.useSub = exports.useAct = exports.JasonProvider = void 0;
|
6
|
+
exports.useEager = exports.useSub = exports.useAct = exports.JasonProvider = void 0;
|
7
7
|
const JasonProvider_1 = __importDefault(require("./JasonProvider"));
|
8
8
|
const useAct_1 = __importDefault(require("./useAct"));
|
9
9
|
const useSub_1 = __importDefault(require("./useSub"));
|
10
|
+
const useEager_1 = __importDefault(require("./useEager"));
|
10
11
|
exports.JasonProvider = JasonProvider_1.default;
|
11
12
|
exports.useAct = useAct_1.default;
|
12
13
|
exports.useSub = useSub_1.default;
|
14
|
+
exports.useEager = useEager_1.default;
|
data/client/lib/makeEager.js
CHANGED
@@ -40,10 +40,10 @@ function default_1(schema) {
|
|
40
40
|
}
|
41
41
|
function useEager(entity, id = null, relations = []) {
|
42
42
|
if (id) {
|
43
|
-
return react_redux_1.useSelector(s => addRelations(s, Object.assign({}, s[entity].entities[String(id)]), entity, relations));
|
43
|
+
return react_redux_1.useSelector(s => addRelations(s, Object.assign({}, s[entity].entities[String(id)]), entity, relations), lodash_1.default.isEqual);
|
44
44
|
}
|
45
45
|
else {
|
46
|
-
return react_redux_1.useSelector(s => addRelations(s, lodash_1.default.values(s[entity].entities), entity, relations));
|
46
|
+
return react_redux_1.useSelector(s => addRelations(s, lodash_1.default.values(s[entity].entities), entity, relations), lodash_1.default.isEqual);
|
47
47
|
}
|
48
48
|
}
|
49
49
|
return useEager;
|
data/client/src/JasonContext.ts
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
import { createContext } from 'react'
|
2
|
+
const eager = function(entity, id, relations) {
|
3
|
+
console.error("Eager called but is not implemented")
|
4
|
+
}
|
2
5
|
|
3
|
-
const context = createContext({ actions: {} as any, subscribe: null, eager
|
6
|
+
const context = createContext({ actions: {} as any, subscribe: null, eager })
|
4
7
|
|
5
8
|
export default context
|
data/client/src/index.ts
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
import _JasonProvider from './JasonProvider'
|
2
2
|
import _useAct from './useAct'
|
3
3
|
import _useSub from './useSub'
|
4
|
+
import _useEager from './useEager'
|
4
5
|
|
5
6
|
export const JasonProvider = _JasonProvider
|
6
7
|
export const useAct = _useAct
|
7
|
-
export const useSub = _useSub
|
8
|
+
export const useSub = _useSub
|
9
|
+
export const useEager = _useEager
|
data/client/src/makeEager.ts
CHANGED
@@ -36,9 +36,9 @@ export default function (schema) {
|
|
36
36
|
|
37
37
|
function useEager(entity, id = null, relations = []) {
|
38
38
|
if (id) {
|
39
|
-
return useSelector(s => addRelations(s, { ...s[entity].entities[String(id)] }, entity, relations))
|
39
|
+
return useSelector(s => addRelations(s, { ...s[entity].entities[String(id)] }, entity, relations), _.isEqual)
|
40
40
|
} else {
|
41
|
-
return useSelector(s => addRelations(s, _.values(s[entity].entities), entity, relations))
|
41
|
+
return useSelector(s => addRelations(s, _.values(s[entity].entities), entity, relations), _.isEqual)
|
42
42
|
}
|
43
43
|
}
|
44
44
|
|
data/lib/jason/version.rb
CHANGED