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

combineFields #3

Open
secundant opened this issue Jan 14, 2023 · 0 comments · May be fixed by #9
Open

combineFields #3

secundant opened this issue Jan 14, 2023 · 0 comments · May be fixed by #9
Milestone

Comments

@secundant
Copy link
Owner

secundant commented Jan 14, 2023

const fields = combineFields({
  fields: {
    name: createField({ defaultValue: '' }),
    age: createField({ defaultValue: 0 })
  }
});

const nested = combineFields({
  fields: {
    a: createField({ defaultValue: 'foo' as const }),
    b: combineFields({
      fields: {
        c: combineFields({
          fields: {
            d: createField({ defaultValue: 'bar' as const })
          }
        })
      }
    })
  }
});

sample({
  clock: buttonClicked,
  source: $external,
  fn: external => ({ b: { c: { d: external } } }),
  target: nested.change
});
@secundant secundant added this to the 0.1.0 milestone Jan 14, 2023
@secundant secundant changed the title [draft] Implement combineFields [draft] combineFields Jan 16, 2023
@secundant secundant changed the title [draft] combineFields combineFields Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant