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

Accidentally isolating DOM source #1

Open
b123400 opened this issue Aug 21, 2019 · 0 comments
Open

Accidentally isolating DOM source #1

b123400 opened this issue Aug 21, 2019 · 0 comments

Comments

@b123400
Copy link
Contributor

b123400 commented Aug 21, 2019

When isolating form like this:

import { isolate } from 'cyclic-form';

isolate(stateLens)(Form)({
  DOM,
  state,
});

It seems Cycle.js automatically assumes all unspecified sources should be isolated with a default scope, which means the above code is equivalent to

import isolate from '@cycle/isolate';

isolate(Form, { state: stateLens, DOM: 'cycle1' /* the default scope name */ })({
  DOM,
  state,
})

This behaviour breaks the submit button because it cannot interfere with form's `submit event.
Something like this is needed, but the current API isn't possible:

import isolate from '@cycle/isolate';

isolate(Form, { state: stateLens, DOM: null /* explicitly prevent isolation */ })({
  DOM,
  state,
})
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