Menu
Effector LogoEffectorDocsAPIBlogTry
ChangelogTwitterGitHub
๐ŸŒœ
๐ŸŒž
Effector LogoEffector
  • Docs
  • API
  • Blog
  • Try
  • Changelog
  • Twitter
  • GitHub
  • Introduction
    • Installation
    • Core Concepts
    • Glossary
    • Examples
    • Ecosystem
  • API
    • effector
      • API Reference
      • Unit creators
        • createStore
        • createEvent
        • createEffect
        • createDomain
      • Unit types
        • Event
        • Store
        • Effect
        • Domain
      • combine
      • restore
      • createApi
      • sample
      • guard
      • attach
      • merge
      • split
      • forward
      • is
      • fromObservable
      • Fork api
        • Scope
        • fork
        • serialize
        • hydrate
        • allSettled
        • scopeBind
      • Babel plugin
      • Low level api
        • clearNode
        • withRegion
        • launch
    • effector-react
      • API Reference
      • Hooks
        • useStore
        • useStoreMap
        • useList
      • Gate API
        • Gate
        • createGate
        • useGate
      • Top-level exports
        • createComponent
        • createStoreConsumer
        • connect
      • effector-react/ssr api
        • useEvent
    • effector-vue
      • API Reference
      • VueEffector
      • ComponentOptions
      • Vue
  • Conventions
    • Naming
    • Best practices
  • TypeScript guide
    • Typing effector
    • Usage with effector-react
  • Recipes
    • Recipes
    • Countdown timer
    • React
      • Counter
      • Effects
      • Forms
      • Gate - a bridge between props and store
      • TODO creator
      • Dynamic form schema
      • TODO list with input validation
      • React Native Example
  • Advanced guide
    • Computation priority
    • Prior Art

createDomain(name?)#

Creates a domain

Arguments#

  1. name? (string): Domain name

Returns#

Domain: New domain

Example#

import {createDomain} from 'effector'
const domain = createDomain() // Unnamed domain
const httpDomain = createDomain('http') // Named domain
const statusCodeChanged = httpDomain.createEvent()
const downloadFx = httpDomain.createEffect()
const apiDomain = httpDomain.createDomain() // nested domain
const $data = httpDomain.createStore({status: -1})

Try it

Edit this page
Last updated on 10/7/2020
Previous
ยซ createEffect
Next
Event ยป

Docs

  • Docs
  • API
  • Changelog

Community

  • Twitter
  • Telegram ๐Ÿ‡ท๐Ÿ‡บ
  • Telegram

More

  • Github
Effector - the state manager
Copyright ยฉ 2020 zerobias