Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
bigslycat committed Oct 19, 2018
1 parent 813883e commit 3dcfee9
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/honeycombs/src/Honeycomb.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
/* @flow */

import { Observable, type ObservableInterface } from 'es-observable';
import {
Observable,
type ObservableInterface,
type ObservableLike,
} from 'es-observable';

import { map } from './map';
import { StoreObservable } from './StoreObservable';
// eslint-disable-next-line no-unused-vars
import { StateSubject } from './StateSubject';
import { Store, type StoreLike } from './Store';
import { Queue } from './Queue';
import { Bee } from './Bee';
import * as bee from './Bee';

export type ActionsSpec<S> = {
[string]: Bee<S, any>,
[string]: bee.Bee<S, any>,
};

export type GetNextType<S> = <B: Bee<S, any>>(B) => $PropertyType<B, 'next'>;
export type GetNextType<S> = <B: bee.Bee<S, any>>(
B,
) => $PropertyType<B, 'next'>;

class Honeycomb<S> extends StoreObservable<S>
implements ObservableInterface<S>, StoreLike<S> {
Expand Down Expand Up @@ -132,8 +137,8 @@ class Honeycomb<S> extends StoreObservable<S>
state: S,
|}> {
const methods = Object.entries(bees).reduce(
(acc, [key, bee]: [string, any]) => {
acc[key] = value => bee.next(value);
(acc, [key, beeInstance]: [string, any]) => {
acc[key] = beeInstance.next;
return acc;
},
{},
Expand Down

0 comments on commit 3dcfee9

Please sign in to comment.