@remote-ui/react
Advanced tools
Comparing version 3.0.5 to 3.1.0
@@ -42,2 +42,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "useRemoteSubscription", { | ||
enumerable: true, | ||
get: function get() { | ||
return _hooks.useRemoteSubscription; | ||
} | ||
}); | ||
@@ -50,2 +56,4 @@ var _rpc = require("@remote-ui/rpc"); | ||
var _components = require("./components"); | ||
var _components = require("./components"); | ||
var _hooks = require("./hooks"); |
@@ -42,2 +42,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "useRemoteSubscription", { | ||
enumerable: true, | ||
get: function () { | ||
return _hooks.useRemoteSubscription; | ||
} | ||
}); | ||
@@ -50,2 +56,4 @@ var _rpc = require("@remote-ui/rpc"); | ||
var _components = require("./components"); | ||
var _components = require("./components"); | ||
var _hooks = require("./hooks"); |
@@ -6,3 +6,4 @@ export { retain, release } from '@remote-ui/rpc'; | ||
export { createRemoteReactComponent } from './components'; | ||
export { useRemoteSubscription } from './hooks'; | ||
export type { ReactPropsFromRemoteComponentType, ReactComponentTypeFromRemoteComponentType, } from './types'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -13,1 +13,3 @@ "use strict"; | ||
Object.defineProperty(exports, "createRemoteReactComponent", { enumerable: true, get: function () { return components_1.createRemoteReactComponent; } }); | ||
var hooks_1 = require("./hooks"); | ||
Object.defineProperty(exports, "useRemoteSubscription", { enumerable: true, get: function () { return hooks_1.useRemoteSubscription; } }); |
{ | ||
"name": "@remote-ui/react", | ||
"version": "3.0.5", | ||
"version": "3.1.0", | ||
"publishConfig": { | ||
@@ -34,2 +34,3 @@ "access": "public", | ||
"dependencies": { | ||
"@remote-ui/async-subscription": "^2.0.0", | ||
"@remote-ui/core": "^1.6.5", | ||
@@ -41,3 +42,3 @@ "@remote-ui/rpc": "^1.0.17", | ||
}, | ||
"gitHead": "a34a538bda6c70acdc9b32cc7de14b1091dae044" | ||
"gitHead": "062fade9805fe58f5b22cf1c7921615526528689" | ||
} |
@@ -178,1 +178,18 @@ # `@remote-ui/react` | ||
``` | ||
It also exports a hook you can use to get direct, up-to-date access to a `StatefulRemoteSubscribable` created by `@remote-ui/async-subscription`: | ||
```tsx | ||
import type {StatefulRemoteSubscribable} from '@remote-ui/async-subscription'; | ||
import {useRemoteSubscription} from '@remote-ui/react'; | ||
function MyComponent({ | ||
products, | ||
}: { | ||
products: StatefulRemoteSubscribable<{id: string}[]>; | ||
}) { | ||
const currentProducts = useRemoteSubscription(products); | ||
return <>{currentProducts.map((product) => product.id)}</>; | ||
} | ||
``` |
@@ -6,2 +6,3 @@ export {retain, release} from '@remote-ui/rpc'; | ||
export {createRemoteReactComponent} from './components'; | ||
export {useRemoteSubscription} from './hooks'; | ||
export type { | ||
@@ -8,0 +9,0 @@ ReactPropsFromRemoteComponentType, |
@@ -9,3 +9,7 @@ { | ||
"include": ["src/**/*.ts", "src/**/*.tsx"], | ||
"references": [{"path": "../core"}, {"path": "../web-workers"}] | ||
"references": [ | ||
{"path": "../core"}, | ||
{"path": "../async-subscription"}, | ||
{"path": "../web-workers"} | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
496665
143
3216
195
6
+ Added@remote-ui/async-subscription@2.1.16(transitive)