Director 🎥 ✨
State delegation, like a movie star
Examples
API
Director
-
listen(<callback>)
: Function fired on dispatch
calls.
- this adds the callback to an array of callbacks, they are fired sequentially
-
dispatch(<newState>)
: Passes and object to all of the Director's listeners.
Studio
-
add(<label>, <director>
:
Adds a listener to the Director
that stores data (by label
) on every dispatch
call
-
get(Array<label>?)
:
returns data optionally return specific data at a label (strings passed are convereted to Array
, all values that exist in Studio are returned)
-
listen()
:
listens for all studio changes, runs given callback on Studio
changes.
- this adds the callback to an array of callbacks, they are fired sequentially
TalentScout (for React JS)
Props
director
: (optionally and Array
can be sent, and all directors are listened on) Director instance
component
: React component
- Directors' automatically send props down to component
{ ...props }
: All additional props for component -- this is the ideal place for initial state / default props