Skip to content

Commit

Permalink
♻️ removed warning + added loading support
Browse files Browse the repository at this point in the history
  • Loading branch information
harshzalavadiya committed Apr 16, 2020
1 parent 0d23fcd commit d710907
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "use-indexeddb",
"version": "1.0.0",
"version": "1.0.1",
"description": "Lightweight (1KB gzipped) hooks w/ promises for easy IndexedDB access in React ⚓",
"author": "Harsh Zalavadiya",
"module": "dist/use-indexeddb.esm.js",
Expand Down
2 changes: 0 additions & 2 deletions src/constants.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { createContext, useContext, useEffect, useState } from "react";

import { SSRWarning } from "./constants";
import { getActions, getConnection } from "./db";
import { IndexedDBConfig } from "./interfaces";

interface UseIndexedDBProps {
config: IndexedDBConfig;
children?;
loading?;
actions?: typeof getActions;
}

Expand All @@ -24,7 +24,7 @@ const IndexedDBProvider = (props: UseIndexedDBProps) => {
{props.children}
</ObservationCreateContext.Provider>
) : (
<div data-info={SSRWarning} />
props.loading
);
};

Expand Down
2 changes: 1 addition & 1 deletion stories/idb.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const idbConfig: IndexedDBConfig = {
};

export const Default = () => (
<IndexedDBProvider config={idbConfig}>
<IndexedDBProvider config={idbConfig} loading="Loading...">
<IDBOperations />
</IndexedDBProvider>
);

0 comments on commit d710907

Please sign in to comment.