Skip to content

Commit

Permalink
Renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Nov 23, 2023
1 parent 323292a commit 4972612
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 24 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/elements/custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
{
"name": "renderers",
"type": {
"text": "{\n completed: (value: T) => TemplateResult;\n error: ((error: any) => TemplateResult) | { label: string; tooltip: boolean };\n}"
"text": "{\n complete: (value: T) => TemplateResult;\n error: ((error: any) => TemplateResult) | { label: string; tooltip: boolean };\n}"
}
}
],
Expand All @@ -451,7 +451,7 @@
{
"name": "renderers",
"type": {
"text": "{\n completed: (value: T) => TemplateResult;\n error: (error: any) => TemplateResult;\n pending: () => TemplateResult;\n}"
"text": "{\n complete: (value: T) => TemplateResult;\n error: (error: any) => TemplateResult;\n pending: () => TemplateResult;\n}"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion packages/elements/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@holochain-open-dev/elements",
"version": "0.8.3",
"version": "0.8.4",
"description": "Common utilities and elements to build Holochain web applications",
"author": "[email protected]",
"main": "dist/index.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/elements/src/render-async-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AsyncStatus } from "@holochain-open-dev/stores";
* Renders the async status with an <sl-spinner> on pending, and <display-error> on error
*/
export function withSpinnerAndDisplayError<T>(renderers: {
completed: (value: T) => TemplateResult;
complete: (value: T) => TemplateResult;
error: ((error: any) => TemplateResult) | { label: string; tooltip: boolean };
}) {
return renderAsyncStatus({
Expand All @@ -22,22 +22,22 @@ export function withSpinnerAndDisplayError<T>(renderers: {
.tooltip=${renderers.error?.tooltip}
.error=${e}
></display-error> `,
completed: renderers.completed,
complete: renderers.complete,
});
}

/**
* Renders the given AsyncStatus with the given renderers
*/
export function renderAsyncStatus<T>(renderers: {
completed: (value: T) => TemplateResult;
complete: (value: T) => TemplateResult;
error: (error: any) => TemplateResult;
pending: () => TemplateResult;
}) {
return (status: AsyncStatus<T>) => {
switch (status.status) {
case "complete":
return renderers.completed(status.value);
return renderers.complete(status.value);
case "error":
return renderers.error(status.error);
default:
Expand Down
4 changes: 2 additions & 2 deletions packages/stores/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@holochain-open-dev/stores",
"version": "0.8.1",
"version": "0.8.2",
"description": "Re-export of svelte/store, with additional utilities to build reusable holochain-open-dev modules",
"author": "[email protected]",
"main": "dist/index.js",
Expand All @@ -20,7 +20,7 @@
"dependencies": {
"@alenaksu/json-viewer": "^2.0.1",
"@holochain-open-dev/utils": "^0.16.2",
"@holochain/client": "^0.16.5",
"@holochain/client": "^0.16.6",
"@scoped-elements/cytoscape": "^0.2.0",
"@shoelace-style/shoelace": "^2.11.2",
"lit": "^3.0.2",
Expand Down
11 changes: 5 additions & 6 deletions packages/stores/src/holochain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ import {
import {
Action,
ActionHash,
AgentPubKey,
CreateLink,
decodeHashFromBase64,
Delete,
DeleteLink,
encodeHashToBase64,
HoloHash,
SignedActionHashed,
Link,
} from "@holochain/client";
import { Link } from "@holochain/client/lib/hdk/link.js";
import { encode } from "@msgpack/msgpack";
import { readable } from "svelte/store";
import isEqual from "lodash-es/isEqual.js";
Expand All @@ -33,11 +32,11 @@ export function createLinkToLink(
): Link {
return {
author: createLink.hashed.content.author,
link_type: (createLink.hashed.content as any).link_type,
link_type: createLink.hashed.content.link_type,
tag: createLink.hashed.content.tag,
target: createLink.hashed.content.target_address,
timestamp: createLink.hashed.content.timestamp,
zome_index: createLink.hashed.content.zome_id,
zome_index: createLink.hashed.content.zome_index,
create_link_hash: createLink.hashed.hash,
};
}
Expand Down Expand Up @@ -149,8 +148,8 @@ export function latestVersionOfEntryStore<
const nlatestVersion = await fetchLatestVersion();
if (nlatestVersion) {
if (
latestVersion.actionHash.toString() !==
nlatestVersion.actionHash.toString()
latestVersion?.actionHash.toString() !==
nlatestVersion?.actionHash.toString()
) {
latestVersion = nlatestVersion;
set({
Expand Down

0 comments on commit 4972612

Please sign in to comment.