This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
table: 'message', | |
query: { outbound: false } | |
}, | |
{ | |
table: 'organization', | |
query: { type: 'customer' } | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
table: 'message', | |
query: { outbound: false } | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RelevanceDAG.defineCascadeFor('user', async function() { | |
return [ | |
await this.getOrganization(), | |
...(await this.getActiveLoads()) | |
]; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RelevanceDAG.defineCascadeFor('phone_call', function() { | |
return this.getParticipants(); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE load ADD COLUMN user_id INTEGER; | |
ALTER TABLE load | |
ADD CONSTRAINT user_id_constraint | |
FOREIGN KEY (user_id) | |
REFERENCES human(id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { mapDispatchToProps, mapStateToProps } from '../myFancyDecorators' | |
@mapStateToProps((state) => ({ | |
users: state.users | |
})) | |
@mapDispatchToProps((dispatch, ownProps) => ({ | |
getUser(id) { | |
dispatch(ownProps.getUser(id)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mapDispatchToProps = (dispatch, ownProps) => ({ | |
getUser(id) { | |
dispatch(ownProps.getUser(id)) | |
} | |
}) | |
class MyFancyComponent extends React.Component { | |
// react things | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { connect } from 'react-redux' | |
const mapStateToProps = (mapStateToProps, options) => { | |
return connect(mapStateToProps, {}); | |
} | |
const mapDispatchToProps = (mapDispatchToProps, options) => { | |
const mapStateToProps = () => ({}); | |
return connect(mapStateToProps, mapDispatchToProps); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { connect } from 'react-redux' | |
const mapStateToProps = (state) => { | |
return { users: state.users }; | |
} | |
const mapDispatchToProps = (dispatch, ownProps) { | |
return { | |
getUser(id) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { connect } from 'react-redux' | |
class MyFancyComponent extends React.Component { | |
// react things in here | |
} | |
const mapStateToProps = (state) => { | |
return { users: state.users }; | |
} |
NewerOlder