Implement minimum amount for a working matrix.to

This commit is contained in:
Jorik Schellekens
2020-08-17 17:48:13 +01:00
parent f8fe32ffbc
commit 1ad11ed25f
28 changed files with 703 additions and 99 deletions
+6 -3
View File
@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { Client, discoverServer } from "cypher";
import { prefixFetch } from "cypher/src/utils/fetch";
import { prefixFetch, Client, discoverServer } from "matrix-cypher";
type State = {
clientURL: string;
@@ -62,4 +61,8 @@ export const reducer = async (state: State, action: Action): Promise<State> => {
// The null is a hack to make the type checker happy
// create context does not need an argument
export default React.createContext<typeof reducer | null>(null);
const { Provider, Consumer } = React.createContext<typeof reducer | null>(null);
// Quick rename to make importing easier
export const ClientProvider = Provider;
export const ClientConsumer = Consumer;