Skip to content

Instantly share code, notes, and snippets.

'use strict';
import Marionette from 'marionette';
import viewTpl from './boxItemView.hbs!';
import TrashListView from './trashListView.js';
export default Marionette.LayoutView.extend({
template: viewTpl,
tagName: 'li',
regions: {
@belackriv
belackriv / contextMenuRegion.js
Created January 17, 2017 16:15
Mn Close on Click-off region
'use strict';
import Marionette from 'marionette';
export default Marionette.Region.extend({
onShow(view, region, options){
if(!options.event){
throw 'Must Supply an event with contextmenu show';
}
options.event.preventDefault();
@belackriv
belackriv / QueryUnitOfWorkMixin.php
Created March 7, 2018 13:30
Query Unit Of Work
<?php
namespace App\Library\Mixin;
trait QueryUnitOfWorkMixin
{
public function queryUow($className, array $properties)
{
foreach($this->getEntityManager()->getUnitOfWork()->getScheduledEntityInsertions() as $entity){
if(is_a($entity, $className)){
@belackriv
belackriv / authListenerMiddleware.ts
Last active March 15, 2024 15:29
Using Simple Auth State
import { createListenerMiddleware } from "@reduxjs/toolkit";
import { authApi } from './authApi';
import { api } from './baseApi';
import type { RootState } from "../store";
export const authListenerMiddleware = createListenerMiddleware();
authListenerMiddleware.startListening({
matcher: authApi.endpoints.login.matchFulfilled,
effect: (action, listenerApi) => {
localStorage.setItem(