From ead4281ec850b6af1178afc656a91d33e9f8aa73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20=C5=85ikiforovs?= Date: Sat, 14 May 2016 20:12:32 +0300 Subject: [PATCH] Reflux (#9308) * reflux: add ListenerMixin * reflux: allow Reflux.createAction() `options` argument is optional. Readme says: "Create an action by calling Reflux.createAction with an optional options object." --- reflux/reflux-tests.ts | 5 +++++ reflux/reflux.d.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/reflux/reflux-tests.ts b/reflux/reflux-tests.ts index f626c2900b..d129c09a20 100644 --- a/reflux/reflux-tests.ts +++ b/reflux/reflux-tests.ts @@ -43,6 +43,7 @@ Reflux.createAction({ children: ["progressed", "completed", "failed"] }); +var action = Reflux.createAction(); var actions = Reflux.createActions(["fireBall", "magicMissile"]); @@ -57,3 +58,7 @@ var Store = Reflux.createStore({ // bzzzzapp! } }); + +var ReactComponent = { + mixins: [Reflux.ListenerMixin] +}; \ No newline at end of file diff --git a/reflux/reflux.d.ts b/reflux/reflux.d.ts index f7395b175e..b2d96dd621 100644 --- a/reflux/reflux.d.ts +++ b/reflux/reflux.d.ts @@ -47,7 +47,7 @@ declare module RefluxCore { function createStore(definition: StoreDefinition): Store; - function createAction(definition: ActionsDefinition): any; + function createAction(definition?: ActionsDefinition): any; function createActions(definition: ActionsDefinition): any; function createActions(definitions: string[]): any; @@ -55,6 +55,8 @@ declare module RefluxCore { function connect(store: Store, key?: string):void; function listenTo(store: Store, handler: string):void; function setState(state: any):void; + + function ListenerMixin(): any; } declare module "reflux" {