Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind reading functions to the lens #2

Closed
couzic opened this issue Sep 20, 2017 · 1 comment
Closed

Bind reading functions to the lens #2

couzic opened this issue Sep 20, 2017 · 1 comment

Comments

@couzic
Copy link
Owner

couzic commented Sep 20, 2017

It would allow more concise syntax. For example:

const state$: Observable<State> = ...
const lens = createLens<State>

const a$: Observable<A> = state$.map(state => lens.focusOn('a').read(state))

The last line could be written:

const a$: Observable<A> = state$.map(lens.focusOn('a').read)
@couzic
Copy link
Owner Author

couzic commented Oct 29, 2017

NO GO. It would add a performance overhead for each created Lens. Problem with be solved with more API design.

@couzic couzic closed this as completed Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant