setState(state)

Merge the provided state object into the current state,

πŸ“˜

Auto notifies listeners

Calls to setState and replaceState emit a change event that notifies listeners, only if the state has been changed by the call.

fluxapp.registerStore('user', {
   actions: {
     onUserLogin: 'user.login',
   },
        
   onUserLogin: function(user) {
     this.setState({
      token: user.token
     });
   }
 });

πŸ‘

On to replaceState(state)