Skip to content

Commit

Permalink
chore: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stuf committed Oct 16, 2019
1 parent 71dd3c1 commit 2a85a7d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/common/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* @namespace common
*/
import * as U from 'karet.util';
import * as R from 'kefir.ramda';
import * as L from 'kefir.partial.lenses';

//
Expand Down
16 changes: 16 additions & 0 deletions src/common/shared.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as R from 'ramda';
import * as K from 'kefir';

import { MaybeObservable } from 'types';

export const toProperty = <T>(
maybeObs: MaybeObservable<T>,
): K.Property<T, any> => {
if (maybeObs instanceof K.Property) {
return maybeObs;
} else if (maybeObs instanceof K.Observable) {
return maybeObs.toProperty();
} else {
return K.constant(maybeObs);
}
};

0 comments on commit 2a85a7d

Please sign in to comment.