@appsflow/redux
Advanced tools
Comparing version 0.0.0-alpha.17 to 0.0.0-alpha.18
import React from "react"; | ||
import { Routes, getRoutes } from "./managers/routes"; | ||
import { Controller } from "./controller"; | ||
export declare const useCurrentRoute: (prefix: string) => [any, React.Dispatch<any>]; | ||
export declare const useCurrentRoute: (prefix: string) => [{ | ||
[key: string]: import("@appsflow/core/dist/es/src/command-bases").CommandBase; | ||
}, React.Dispatch<React.SetStateAction<{ | ||
[key: string]: import("@appsflow/core/dist/es/src/command-bases").CommandBase; | ||
}>>]; | ||
export declare function useControllerProperty(name: string, property: string): any; | ||
@@ -6,0 +10,0 @@ export declare function useController(name: string): any; |
{ | ||
"name": "@appsflow/redux", | ||
"version": "0.0.0-alpha.17", | ||
"version": "0.0.0-alpha.18", | ||
"description": "AppFlow redux", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -13,13 +13,14 @@ import React from "react"; | ||
// eslint-disable-next-line no-undef | ||
const state = React.useState( ( window as any ).$flow.managers.routes.current ), | ||
const state = React.useState( getRoutes().current ), | ||
[ , setCurrent ] = state; | ||
// eslint-disable-next-line no-undef | ||
( window as any ).$flow.managers.routes.watch( () => { | ||
getRoutes().watch( () => { | ||
// eslint-disable-next-line no-undef | ||
const actual = ( window as any ).$flow.managers.routes.current; | ||
const actual = getRoutes().current; | ||
// @ts-ignore | ||
if ( actual.includes( prefix ) ) { | ||
// eslint-disable-next-line no-undef | ||
setCurrent( ( window as any ).$flow.managers.routes.current ); | ||
setCurrent( getRoutes().current ); | ||
} | ||
@@ -26,0 +27,0 @@ } ); |
Sorry, the diff of this file is too big to display
98761
2006